57% e-shops-cart2

Code Review | e-shopsカート2

WordPress plugin e-shopsカート2 scored57%from 54 tests.

About plugin

  • Plugin page: e-shops-cart2
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Dec 26, 2017
  • Latest release: Oct 5, 2020
  • Number of updates: 11
  • Update frequency: every 92.6 days
  • Top authors: hands01 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /1,364 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼0.85MB] [CPU: ▼39.73ms] Passed 4 tests

An overview of server-side resources used by e-shopsカート2
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2541.02 ▼2.19
Dashboard /wp-admin3.11 ▼0.2426.42 ▼42.39
Posts /wp-admin/edit.php3.11 ▼0.2525.61 ▼27.18
Add New Post /wp-admin/post-new.php3.11 ▼2.7825.94 ▼77.97
Media Library /wp-admin/upload.php3.11 ▼0.1226.98 ▼11.39
商品一覧 /wp-admin/admin.php?page=ec2_item_list3.1122.40
テンプレート一覧 /wp-admin/admin.php?page=ec2_tmpl_list3.1125.19
設定 /wp-admin/admin.php?page=ec2_settings3.1127.81

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 12 new files
Database: 3 new tables, 6 new options
New tables
wp_eshops_cart2_tmpl
wp_eshops_cart2_preview
wp_eshops_cart2_items
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for e-shopsカート2
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8913.21 ▼1.551.70 ▲0.0446.23 ▲2.34
Dashboard /wp-admin2,238 ▲354.94 ▼0.97101.84 ▼0.3878.36 ▲31.65
Posts /wp-admin/edit.php2,135 ▲322.06 ▲0.0234.91 ▼7.4340.28 ▲2.81
Add New Post /wp-admin/post-new.php1,747 ▲20221.00 ▼2.19661.20 ▼31.39110.81 ▲40.62
Media Library /wp-admin/upload.php1,429 ▲354.29 ▲0.03112.81 ▲10.2996.70 ▲53.12
商品一覧 /wp-admin/admin.php?page=ec2_item_list7071.367.3553.26
テンプレート一覧 /wp-admin/admin.php?page=ec2_tmpl_list8682.0325.5750.35
設定 /wp-admin/admin.php?page=ec2_settings8752.0725.4747.43

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_eshops_cart2_tmpl
    • wp_eshops_cart2_preview
    • wp_eshops_cart2_items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ec2_settings
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/e-shops-cart2/eshops-cart2.php on line 93
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/e-shops-cart2/eshops-cart2.php on line 93
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/e-shops-cart2/widget/eshops-cart2-widget.php:5
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/upgrade.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/e-shops-cart2/eshops-cart2.php on line 93
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/e-shops-cart2/widget/eshops_cart2_new_custom.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/e-shops-cart2/eshops-cart2.php:100

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (商品検索機能も充実。) image not found
The official readme.txt is a good inspiration

e-shops-cart2/eshops-cart2.php 77% from 13 tests

The entry point to "e-shopsカート2" version 1.0.3 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("e-shops-cart2.php" instead of "eshops-cart2.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected3,682 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP67421,1023,360
JavaScript2256247
CSS118075

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity60.12
▷ Minimum class complexity1.00
▷ Maximum class complexity195.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes114.29%
Methods168
▷ Static methods169.52%
▷ Public methods13278.57%
▷ Protected methods2917.26%
▷ Private methods74.17%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants32
▷ Global constants39.38%
▷ Class constants2990.62%
▷ Public constants29100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png140.87KB39.81KB▼ 71.74%
eshops-cart2.png0.48KB0.36KB▼ 26.17%