Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing dashboard icon #288

Closed
1 of 4 tasks
stefanos82 opened this issue Oct 16, 2020 · 17 comments
Closed
1 of 4 tasks

Missing dashboard icon #288

stefanos82 opened this issue Oct 16, 2020 · 17 comments

Comments

@stefanos82
Copy link

Describe the bug

After I updated Classic Commerce to its latest version, I have noticed its dashboard icon is not there.

To Reproduce

...

Screenshots

image

Expected behavior

To have a dashboard icon right next to Commerce?

Isolating the problem (mark completed items with an [x]):

  • I have deactivated other plugins and confirmed this bug occurs when only Classic Commerce plugin is active.
  • I have deactivated and reactivated the plugin and the dashboard icon is still missing.
  • This bug happens with a default ClassicPress theme active.
  • I can reproduce this bug consistently using the steps above.

ClassicPress Environment

CMS Environment

Home URL: https://cpdemo.cy
Site URL: https://cpdemo.cy
CC Version: 1.0.0
WC Version: 3.5.3
Log Directory Writable: ✔
CMS Version: ✔ You are running ClassicPress Version 1.2.0
Multisite: –
Memory Limit: 256 MB
Debug Mode: –
Cron: ✔
Language: en_US
External object cache: –

Server Environment

Server Info: nginx/1.18.0
PHP Version: 7.4.11
PHP Post Max Size: 20 MB
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.72.0
OpenSSL/1.1.1g

SUHOSIN Installed: –
MySQL Version: 5.5.5-10.3.24-MariaDB-2
Max Upload Size: 20 MB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

Database

CC Database Version: 3.5.3
WC Database Prefix: cp45345_
Total Database Size: 1.90MB
Database Data Size: 0.97MB
Database Index Size: 0.93MB
cp45345_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB
cp45345_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB
cp45345_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB
cp45345_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.05MB
cp45345_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB
cp45345_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB
cp45345_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB
cp45345_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB
cp45345_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB
cp45345_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB
cp45345_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB
cp45345_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB
cp45345_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB
cp45345_woocommerce_log: Data: 0.02MB + Index: 0.02MB
cp45345_commentmeta: Data: 0.02MB + Index: 0.03MB
cp45345_comments: Data: 0.02MB + Index: 0.09MB
cp45345_links: Data: 0.02MB + Index: 0.02MB
cp45345_options: Data: 0.28MB + Index: 0.02MB
cp45345_postmeta: Data: 0.14MB + Index: 0.11MB
cp45345_posts: Data: 0.05MB + Index: 0.06MB
cp45345_termmeta: Data: 0.02MB + Index: 0.03MB
cp45345_terms: Data: 0.02MB + Index: 0.03MB
cp45345_term_relationships: Data: 0.02MB + Index: 0.02MB
cp45345_term_taxonomy: Data: 0.02MB + Index: 0.03MB
cp45345_usermeta: Data: 0.02MB + Index: 0.03MB
cp45345_users: Data: 0.02MB + Index: 0.05MB
cp45345_wc_download_log: Data: 0.02MB + Index: 0.03MB
cp45345_wc_webhooks: Data: 0.02MB + Index: 0.02MB

Post Type Counts

attachment: 22
page: 7
post: 2
product: 18
product_variation: 7
revision: 1

Security

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

Active Plugins (1)

Classic Commerce: by ClassicPress Research Team – 1.0.0

Settings

API Enabled: –
Force SSL: –
Currency: EUR (€)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

WC Pages

Shop base: #6 - /shop/
Cart: #7 - /cart/
Checkout: #8 - /checkout/
My account: #9 - /my-account/
Terms and conditions: ❌ Page not set

Theme

Name: Storefront
Version: 2.8.0
Author URL: https://woocommerce.com/
Child Theme: ❌ – If you are modifying Classic Commerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
Classic Commerce Support: ✔

Templates

Overrides: –

@ghost
Copy link

ghost commented Oct 16, 2020

Hi stefanos. There was small change made to that icon in the last update. Can you clear your browser cache, or maybe try a different browser? It sounds like it is still trying to find the old icon.

@stefanos82
Copy link
Author

I just checked it with chromium in incognito and the issue remains the same.

image

@ghost
Copy link

ghost commented Oct 16, 2020

OK, thanks. We'll have to wait for @timbocode to wake up. He did that and may have an idea what is going on.

@timbocode
Copy link
Contributor

Thanks for providing comprehensive details @stefanos82. This always helps.

A couple of things to check first of all:

  1. can you confirm that the following file exists on your installation:

classic-commerce/assets/images/classic-commerce-dashicon-white-on-transparent.svg

  1. can you make sure the following line is in your php.ini file:

allow_url_fopen=1

If you don't have access to php.ini, adding the following line to your wp-config.php file has the same effect:

@ini_set( 'allow_url_fopen', '1' );

After adding this, refresh your admin page to see if the image appears.

Could you check these two things and report back please.

Thanks.

@stefanos82
Copy link
Author

Thanks for providing comprehensive details @stefanos82. This always helps.

A couple of things to check first of all:

1. can you confirm that the following file exists on your installation:

classic-commerce/assets/images/classic-commerce-dashicon-white-on-transparent.svg

The file it's there.

1. can you make sure the following line is in your `php.ini` file:

allow_url_fopen=1

It's already enabled.

If you don't have access to php.ini, adding the following line to your wp-config.php file has the same effect:

@ini_set( 'allow_url_fopen', '1' );

After adding this, refresh your admin page to see if the image appears.

Could you check these two things and report back please.

Thanks.

@stefanos82
Copy link
Author

stefanos82 commented Oct 16, 2020

Currently I'm migrating my local websites from WordPress to ClassicPress and seems like the SSL is the culprit:

Warning: file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed in /var/www/html/stavros90/wp-content/plugins/classic-commerce/includes/admin/class-wc-admin-menus.php on line 56

Warning: file_get_contents(): Failed to enable crypto in /var/www/html/stavros90/wp-content/plugins/classic-commerce/includes/admin/class-wc-admin-menus.php on line 56

Warning: file_get_contents(https://stavros90.cy/wp-content/plugins/classic-commerce/assets/images/classic-commerce-dashicon-white-on-transparent.svg): failed to open stream: operation failed in /var/www/html/stavros90/wp-content/plugins/classic-commerce/includes/admin/class-wc-admin-menus.php on line 56

@timbocode
Copy link
Contributor

Thanks for the update @stefanos82. Sorry it's still not working.

Yes, it does appear to be SSL related and it might be something you need to speak to your hosting company about. But first, could you try adding the following line to your php.ini file:

openssl.cafile=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem

I'm not certain that this will work as I suspect this needs to go into the "master" php.ini configuration and also, your account may not have direct access to the /etc/pki path but it's worth a try.

If this fails, could you contact your host and inform them of these errors. They should be able to fix it quite quickly.

Let us know how you get on.

Thanks.

@stefanos82
Copy link
Author

There's no need to contact any hosting company as I'm using mkcert for local development.

The problem is only one website reported this type of issue, whereas others work just fine, but of course without the svg image displayed as dashicon.

@stefanos82
Copy link
Author

stefanos82 commented Oct 16, 2020

Is there a particular reason we pass the whole URL inside file_get_contents()?

Couldn't we pass relative path accordingly? That is from

file_get_contents(https://stavros90.cy/wp-content/plugins/classic-commerce/assets/images/classic-commerce-dashicon-white-on-transparent.svg)

to

file_get_contents('assets/images/classic-commerce-dashicon-white-on-transparent.svg')

@stefanos82
Copy link
Author

So the problem is a WordPress issue, about how it handles certificates: FiloSottile/mkcert#165

@timbocode
Copy link
Contributor

There's no particular reason for using the URL instead of a file path. It's just that I've not come across this particular problem before.

Yes, I read that FiloSottile issue a little earlier but using a file path instead of a URL will avoid this particular issue.

I have started working on a fix using a path instead of a URL which I hope to publish within the hour or so.

Thanks for the info.

@stefanos82
Copy link
Author

Will I get informed via updates or should I download it from github anew?

@stefanos82
Copy link
Author

You can replace

$icon_svg = file_get_contents( WC()->plugin_url() . '/assets/images/classic-commerce-dashicon-white-on-transparent.svg' );

with

$icon_svg = file_get_contents( dirname( dirname( __DIR__ ) ) . '/assets/images/classic-commerce-dashicon-white-on-transparent.svg' );

and should work as expected.

@timbocode
Copy link
Contributor

Will I get informed via updates or should I download it from github anew?

You will get a notification in your admin dashboard so you can just update it as you would any other plugin.

PR #289 has been created. I hope to publish the new release shortly.

@stefanos82
Copy link
Author

Yeah, I commented in it.

@timbocode
Copy link
Contributor

Closed by #289

@stefanos82
Copy link
Author

Good job everyone 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants