78% change-number-products-per-page

Code Review | Change number of products displayed per page for WooCommerce

WordPress plugin Change number of products displayed per page for WooCommerce scored 78% from 54 tests.

About plugin

  • Plugin page: change-number-pro...
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7.2
  • WordPress version: 6.3.1
  • First release: Jun 29, 2021
  • Latest release: Jul 1, 2021
  • Number of updates: 4
  • Update frequency: every 0.8 days
  • Top authors: khaledlajili (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 320 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
This plugin's installer ran successfully

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

Analyzing server-side resources used by Change number of products displayed per page for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.19 ▼7.90
Dashboard /wp-admin3.31 ▲0.0145.11 ▼2.21
Posts /wp-admin/edit.php3.36 ▲0.0144.68 ▼1.11
Add New Post /wp-admin/post-new.php5.89 ▲0.0190.01 ▼4.85
Media Library /wp-admin/upload.php3.23 ▲0.0034.29 ▲1.54
Number of Products Per Page /wp-admin/admin.php?page=change-number-products-per-page3.2329.05

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Change number of products displayed per page for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.21 ▼1.171.74 ▼0.2042.53 ▼4.19
Dashboard /wp-admin2,206 ▲185.81 ▲0.9099.14 ▲0.2038.04 ▼6.37
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0239.30 ▼0.7034.06 ▼1.45
Add New Post /wp-admin/post-new.php1,542 ▲1418.59 ▲0.29640.73 ▲14.2952.81 ▼3.74
Media Library /wp-admin/upload.php1,388 ▲34.25 ▲0.0495.33 ▼5.8641.23 ▼1.11
Number of Products Per Page /wp-admin/admin.php?page=change-number-products-per-page7902.0524.6023.88

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=change-number-products-per-page
    • > Notice in wp-content/plugins/change-number-products-per-page/includes/change-number-products-per-page-acp-page.php+11
    Undefined index: add_opt_submit

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
Almost there! Just fix the following items
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/change-number-products-per-page/includes/cnpppw-functions.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/change-number-products-per-page/includes/change-number-products-per-page-acp-page.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/change-number-products-per-page/change-number-products-per-page.php:27

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: products, number of products, shop page, modify number of products, products per page...

change-number-products-per-page/change-number-products-per-page.php 85% from 13 tests

The main PHP file in "Change number of products displayed per page for WooCommerce" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Domain Path: Prefix the domain path with a forward slash character ("/")
  • Domain Path: The domain path should use only dashes and lowercase characters ("")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected73 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3422873

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin