83% phc-fx-woocommerce

Code Review | WooCommerce Plugin for PHC FX

WordPress plugin WooCommerce Plugin for PHC FX scored83%from 54 tests.

About plugin

  • Plugin page: phc-fx-woocommerce
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1.1-4.5
  • WordPress version: 6.3.1
  • First release: May 12, 2015
  • Latest release: Apr 28, 2016
  • Number of updates: 39
  • Update frequency: every 9.1 days
  • Top authors: phcwordpress (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,016 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.26ms] Passed 4 tests

This is a short check of server-side resources used by WooCommerce Plugin for PHC FX
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0042.48 ▲0.30
Dashboard /wp-admin3.31 ▲0.0051.68 ▼2.40
Posts /wp-admin/edit.php3.36 ▲0.0048.81 ▼9.64
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.37 ▼10.59
Media Library /wp-admin/upload.php3.23 ▲0.0036.66 ▼2.40

Server storage [IO: ▲0.61MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WooCommerce Plugin for PHC FX
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.29 ▲0.021.80 ▲0.1746.23 ▲4.00
Dashboard /wp-admin2,198 ▲215.70 ▲0.0590.27 ▼0.3839.78 ▼0.39
Posts /wp-admin/edit.php2,097 ▼32.03 ▲0.0536.05 ▼4.5336.21 ▼1.18
Add New Post /wp-admin/post-new.php1,526 ▼223.25 ▼0.10692.97 ▲27.1265.65 ▲12.60
Media Library /wp-admin/upload.php1,403 ▲34.23 ▲0.00106.93 ▼2.6748.11 ▲3.51

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/phc-fx-woocommerce/phcfx-woocommerce-settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/phc-fx-woocommerce/settings/backend.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/phc-fx-woocommerce/settings/import-products.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (List of All Products), #2 (Initialize plugin and login), #3 (Configurations of plugin)
You can look at the official readme.txt

phc-fx-woocommerce/phcfx-woocommerce.php 92% from 13 tests

The main PHP file in "WooCommerce Plugin for PHC FX" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("phc-fx-woocommerce.php" instead of "phcfx-woocommerce.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin5,005 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP64426004,003
CSS21437508
JavaScript23647494

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 151)
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity647.00
▷ Minimum class complexity647.00
▷ Maximum class complexity647.00
Average method complexity12.54
▷ Minimum method complexity1.00
▷ Maximum method complexity151.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods56
▷ Static methods11.79%
▷ Public methods5496.43%
▷ Protected methods00.00%
▷ Private methods23.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
9 PNG files occupy 0.25MB with 0.10MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png69.63KB37.16KB▼ 46.64%
images/logo_phcfx.png47.14KB16.72KB▼ 64.53%
images/update.png0.29KB0.26KB▼ 12.08%
screenshot-2.png68.25KB38.23KB▼ 43.99%
images/plus.png0.27KB0.16KB▼ 41.24%