78% woocommerce-dynamic-sorting

Code Review | WooCommerce Dynamic Sorting

WordPress plugin WooCommerce Dynamic Sorting scored78%from 54 tests.

About plugin

  • Plugin page: woocommerce-dynam...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.8
  • WordPress version: 6.3.1
  • First release: Jan 12, 2014
  • Latest release: Jan 12, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: phill_brown (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,527 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by WooCommerce Dynamic Sorting
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0183.26 ▲0.89
Dashboard /wp-admin3.31 ▼0.0387.67 ▼25.41
Posts /wp-admin/edit.php3.43 ▲0.0785.36 ▲5.63
Add New Post /wp-admin/post-new.php5.89 ▲0.01140.76 ▼7.00
Media Library /wp-admin/upload.php3.24 ▲0.0160.18 ▼0.59

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 178 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Dynamic Sorting
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,797 ▲5114.52 ▲0.233.60 ▼0.5175.73 ▼2.14
Dashboard /wp-admin2,210 ▲254.82 ▼0.07184.02 ▼7.4278.50 ▼29.26
Posts /wp-admin/edit.php2,098 ▲92.01 ▲0.0178.94 ▲9.3977.79 ▼0.41
Add New Post /wp-admin/post-new.php1,366 ▼3117.34 ▼0.43898.78 ▼86.0785.38 ▲14.15
Media Library /wp-admin/upload.php1,389 ▲74.25 ▲0.04172.78 ▼17.9689.24 ▼12.96

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 20× PHP files output non-empty strings when accessed directly via GET requests (only 10 are shown):
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/contacts/simple.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/batch.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/plus/simple.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/siteVerification/simple.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/userinfo/index.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/tasks/index.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/plus/index.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/moments/simple.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/prediction/index.php
    • > /wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/urlshortener/index.php
  • 164× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      require_once(): Failed opening required '../../src/contrib/Google_AdexchangebuyerService.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/adexchangebuyer/BaseExample.php on line 22
    • > PHP Warning
      require_once(../../src/contrib/Google_AdsenseService.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/adsense/BaseExample.php on line 21
    • > PHP Fatal error
      require_once(): Failed opening required 'auth/Google_Signer.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/test/general/AuthTest.php on line 21
    • > PHP Warning
      require_once(BaseTest.php): failed to open stream: No such file or directory in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/test/general/ApiBatchRequestTest.php on line 21
    • > PHP Fatal error
      require_once(): Failed opening required '../../src/contrib/Google_AdexchangebuyerService.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/adexchangebuyer/BaseExample.php on line 22
    • > PHP Fatal error
      require_once(): Failed opening required '../../src/contrib/apiAdsensehostService.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/adsensehost/BaseExample.php on line 22
    • > PHP Notice
      Undefined index: access_token in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/analytics/demo/storage.php on line 44
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/src/contrib/Google_PagespeedonlineService.php:25
    • > PHP Fatal error
      require_once(): Failed opening required '../../src/apiClient.php' (include_path='.:/usr/share/php') in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/examples/adsensehost/AdSenseAuth.php on line 26
    • > PHP Fatal error
      Uncaught Error: Class 'Google_ServiceResource' not found in wp-content/plugins/woocommerce-dynamic-sorting/includes/vendor/google-api-php-client/src/contrib/Google_LatitudeService.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
5 plugin tags: orderby, products, shop, sorting, woocommerce

woocommerce-dynamic-sorting/plugin.php 92% from 13 tests

The main file in "WooCommerce Dynamic Sorting" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-dynamic-sorting.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin35,087 lines of code in 165 files:
LanguageFilesBlank linesComment linesLines of code
PHP1542,56510,79334,438
CSS9105121582
HTML151456
XML10011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.08
Average class complexity2.24
▷ Minimum class complexity1.00
▷ Maximum class complexity49.00
Average method complexity1.16
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes833
▷ Abstract classes80.96%
▷ Concrete classes82599.04%
▷ Final classes00.00%
Methods6,598
▷ Static methods300.45%
▷ Public methods6,51098.67%
▷ Protected methods190.29%
▷ Private methods691.05%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants37
▷ Global constants1027.03%
▷ Class constants2772.97%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin