10% shopping-pages

Code Review | WP Shopping Pages

WordPress plugin WP Shopping Pages scored 10% from 54 tests.

About plugin

  • Plugin page: shopping-pages
  • Plugin version: 1.14
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Mar 27, 2009
  • Latest release: Sep 4, 2014
  • Number of updates: 16
  • Update frequency: every 124.2 days
  • Top authors: thoefter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active / 11,820 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/shopping-pages/wpsp.class.php+25
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼1.89MB] [CPU: ▼203.22ms] Passed 4 tests

A check of server-side resources used by WP Shopping Pages
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.75 ▼1.094.40 ▼63.31
Dashboard /wp-admin1.76 ▼1.306.90 ▼32.84
Posts /wp-admin/edit.php1.76 ▼1.343.85 ▼35.53
Add New Post /wp-admin/post-new.php1.76 ▼3.673.57 ▼681.21
Media Library /wp-admin/upload.php1.76 ▼1.243.66 ▼18.31
Templates /wp-admin/admin.php?page=amtp-templates-page1.763.53
ShoppingPages /wp-admin/admin.php?page=amtp-admin-handle1.765.04
Options /wp-admin/admin.php?page=amtp-addpages-page1.763.70

Server storage [IO: ▲0.11MB] [DB: ▲0.01MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 20 new files
Database: 3 new tables, 1 new option
New tables
wp_wpsp_ebaycache
wp_wpsp_templates
wp_wpsp_pages
New WordPress options
wpsp_options

Browser metrics Passed 4 tests

WP Shopping Pages: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,705 ▲10415.52 ▼0.515.29 ▼0.6176.85 ▼40.27
Dashboard /wp-admin2,968 ▲736.07 ▼0.05121.01 ▼12.72173.58 ▼8.02
Posts /wp-admin/edit.php2,778 ▲353.24 ▲0.0164.15 ▲1.25136.37 ▲1.26
Add New Post /wp-admin/post-new.php3,840 ▲2619.20 ▲0.34432.80 ▼16.63162.69 ▲0.55
Media Library /wp-admin/upload.php1,792 ▲405.51 ▲0.02148.51 ▲4.11188.03 ▲5.52
Templates /wp-admin/admin.php?page=amtp-templates-page1,8242.4855.18120.45
ShoppingPages /wp-admin/admin.php?page=amtp-admin-handle1,8582.3858.79151.33
Options /wp-admin/admin.php?page=amtp-addpages-page1,7692.3655.10135.49

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
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/shopping-pages/shoppingpages.php+138
    Undefined index: action

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=amtp-addpages-page
    • > Notice in wp-content/plugins/shopping-pages/shoppingpages.php+138
    Undefined index: action
    • > GET request to /wp-admin/admin.php?page=amtp-templates-page
    • > Notice in wp-content/plugins/shopping-pages/wpsp.class.php+167
    Undefined index: template
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=amtp-templates-page
    • > Notice in wp-content/plugins/shopping-pages/includes/add_template_form.php+122
    Undefined variable: templ
    • > GET request to /wp-admin/admin.php?page=amtp-templates-page
    • > Notice in wp-content/plugins/shopping-pages/includes/add_template_form.php+110
    Trying to get property 'tmpl_title' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=amtp-templates-page
    • > Notice in wp-content/plugins/shopping-pages/includes/add_template_form.php+116
    Trying to get property 'tmpl_type' of non-object
    • > GET request to /wp-admin/admin.php?page=amtp-templates-page
    • > Notice in wp-content/plugins/shopping-pages/includes/add_template_form.php+122
    Trying to get property 'tmpl_code' of non-object
    • > GET request to /wp-admin/admin.php?page=amtp-templates-page
    • > Notice in wp-content/plugins/shopping-pages/includes/add_template_form.php+126
    Undefined index: edit
    • > GET request to /wp-admin/admin.php?page=amtp-admin-handle
    • > Notice in wp-content/plugins/shopping-pages/wpsp.class.php+184
    Undefined index: addpages
    • > GET request to /wp-admin/admin.php?page=amtp-admin-handle
    • > Notice in wp-content/plugins/shopping-pages/includes/add_pages_form.php+127
    Undefined variable: option_ebay_templates
    • > GET request to /wp-admin/admin.php?page=amtp-addpages-page
    • > Notice in wp-content/plugins/shopping-pages/wpsp.class.php+67
    Undefined index: reset_options
    • > GET request to /wp-admin/admin.php?page=amtp-addpages-page
    • > Notice in wp-content/plugins/shopping-pages/wpsp.class.php+86
    Undefined index: submitoptions

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
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/shopping-pages/shoppingpages.php:22
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/shopping-pages/includes/add_pages_form.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/shopping-pages/wpsp.class.php:1119
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/shopping-pages/includes/options.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/shopping-pages/includes/add_template_form.php:3

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Please fix the following attributes:
  • Tags: There are too many tags (14 tag instead of maximum 10)
The official readme.txt is a good inspiration

shopping-pages/shoppingpages.php 92% from 13 tests

"WP Shopping Pages" version 1.14's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 ("shopping-pages.php" instead of "shoppingpages.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected1,679 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP5251931,679

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity179.00
▷ Minimum class complexity179.00
▷ Maximum class complexity179.00
Average method complexity8.42
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods24
▷ Static methods00.00%
▷ Public methods24100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/3-5.png0.52KB0.41KB▼ 21.79%
images/2-5.png0.52KB0.41KB▼ 22.06%
images/5.png0.35KB0.25KB▼ 28.17%
images/2.png0.48KB0.37KB▼ 22.70%
images/1.png0.46KB0.36KB▼ 21.06%