10% content-shelf-shopping-cart

Code Review | Content Shelf Shopping Cart

WordPress plugin Content Shelf Shopping Cart scored10%from 54 tests.

About plugin

  • Plugin page: content-shelf-sho...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.3
  • WordPress version: 6.3.1
  • First release: Nov 28, 2015
  • Latest release: Feb 25, 2016
  • Number of updates: 17
  • Update frequency: every 5.4 days
  • Top authors: contentshelf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,307 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin cannot be installed
    • > Notice in wp-content/plugins/content-shelf-shopping-cart/contentshelf-shopping-cart.php+19
    Constant WP_DEBUG already defined

Server metrics [RAM: ▼1.95MB] [CPU: ▼50.63ms] Passed 4 tests

This is a short check of server-side resources used by Content Shelf Shopping Cart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.04 ▼1.423.99 ▼37.45
Dashboard /wp-admin2.06 ▼1.246.01 ▼40.54
Posts /wp-admin/edit.php2.06 ▼1.296.40 ▼40.81
Add New Post /wp-admin/post-new.php2.06 ▼3.825.54 ▼83.71
Media Library /wp-admin/upload.php2.06 ▼1.176.28 ▼28.89
Plugin Settings /wp-admin/admin.php?page=contentshelf-store-settings2.065.38
Plugin Setup /wp-admin/admin.php?page=contentshelf2.066.09

Server storage [IO: ▲0.05MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Just a few items left to fix
  • There were 1 file (0.00KB) illegally modified outside of "wp-content/plugins/content-shelf-shopping-cart/" and "wp-content/uploads/"
    • (new file) wp-content/logs/.empty
Filesystem: 26 new files
Database: no new tables, 12 new options
New WordPress options
widget_recent-comments
widget_contentshelf_search
can_compress_scripts
widget_contentshelf_cart_count
widget_recent-posts
contentshelf_store_page_id
widget_contentshelf_language
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
...

Browser metrics Passed 4 tests

Checking browser requirements for Content Shelf Shopping Cart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲5513.23 ▼1.171.72 ▼0.2438.60 ▼6.01
Dashboard /wp-admin2,232 ▲445.85 ▲0.9296.29 ▼17.7679.33 ▲33.67
Posts /wp-admin/edit.php2,118 ▲291.98 ▼0.0334.95 ▼6.4130.46 ▼7.92
Add New Post /wp-admin/post-new.php1,553 ▲3423.24 ▲0.06762.85 ▲132.7960.89 ▲9.13
Media Library /wp-admin/upload.php1,414 ▲264.14 ▼0.05109.42 ▲14.4347.07 ▲5.60
Plugin Settings /wp-admin/admin.php?page=contentshelf-store-settings8722.0524.7224.77
Plugin Setup /wp-admin/admin.php?page=contentshelf8432.1923.8725.10

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/content-shelf-shopping-cart/contentshelf-shopping-cart.php+19
    Constant WP_DEBUG already defined
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-posts
    • widget_contentshelf_language
    • widget_contentshelf_search
    • widget_theysaidso_widget
    • widget_contentshelf_cart_count
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=contentshelf
    • > Notice in wp-content/plugins/content-shelf-shopping-cart/contentshelf-shopping-cart.php+19
    Constant WP_DEBUG already defined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=contentshelf
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

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
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-store-page-include.php
  • 16× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/content-shelf-shopping-cart/includes/contentshelf-language-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-store-page.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_contentshelf_store_id() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-language-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_contentshelf_store_id() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-store-include.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_contentshelf_store_id() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-categories-include.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_contentshelf_store_id() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-cart-count-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/content-shelf-shopping-cart/contentshelf-shopping-cart.php:44
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_contentshelf_store_id() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-language-include.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/content-shelf-shopping-cart/contentshelf-store-settings-form.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_contentshelf_store_id() in wp-content/plugins/content-shelf-shopping-cart/templates/contentshelf-cart-count-include.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 18 tag instead of maximum 10
The official readme.txt might help

content-shelf-shopping-cart/contentshelf-shopping-cart.php 92% from 13 tests

The principal PHP file in "Content Shelf Shopping Cart" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("content-shelf-shopping-cart.php" instead of "contentshelf-shopping-cart.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
Success! There were no dangerous files found in this plugin850 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP17165291741
CSS2141101
JavaScript1008

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions34
▷ Named functions34100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cslogo.png3.63KB3.21KB▼ 11.56%
images/icon-sidebar-active.png0.28KB0.44KB0.00%
images/icon-sidebar-default.png0.30KB0.44KB0.00%