73% squirrels-auto-inventory

Code Review | Squirrels Auto Inventory

WordPress plugin Squirrels Auto Inventory scored73%from 54 tests.

About plugin

  • Plugin page: squirrels-auto-in...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5.3
  • WordPress version: 6.3.1
  • First release: Feb 27, 2016
  • Latest release: Jun 23, 2016
  • Number of updates: 12
  • Update frequency: every 9.8 days
  • Top authors: spokanetony (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,472 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.60MB] [CPU: ▼1.68ms] Passed 4 tests

A check of server-side resources used by Squirrels Auto Inventory
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.03 ▲0.5739.28 ▲1.69
Dashboard /wp-admin3.93 ▲0.5951.79 ▼4.90
Posts /wp-admin/edit.php3.98 ▲0.6357.06 ▲13.78
Add New Post /wp-admin/post-new.php6.51 ▲0.6286.12 ▼6.39
Media Library /wp-admin/upload.php3.83 ▲0.6038.80 ▲2.89
Types /wp-admin/edit.php?post_type=squirrels_type3.9547.73
Makes /wp-admin/edit.php?post_type=squirrels_make3.9957.10
Models /wp-admin/edit.php?post_type=squirrels_model4.28112.50
Settings /wp-admin/admin.php?page=squirrels3.8338.22
Inventory /wp-admin/admin.php?page=squirrels_inventory3.9340.93
Features /wp-admin/admin.php?page=squirrels_features3.8638.50

Server storage [IO: ▲0.26MB] [DB: ▲0.29MB] Passed 3 tests

Filesystem and database footprint
The plugin installed successfully
Filesystem: 28 new files
Database: 3 new tables, 7 new options
New tables
wp_squirrels_features
wp_squirrels_images
wp_squirrels_inventory
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
squirrels_inventory_version
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Squirrels Auto Inventory
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,144 ▲39815.22 ▲0.575.83 ▲4.2037.33 ▼4.39
Dashboard /wp-admin2,409 ▲2206.44 ▲1.44126.19 ▲24.5540.51 ▼0.56
Posts /wp-admin/edit.php2,325 ▲2393.35 ▲1.3450.28 ▲12.6931.40 ▼4.06
Add New Post /wp-admin/post-new.php1,582 ▲4018.43 ▼4.87600.22 ▼56.1836.60 ▼17.20
Media Library /wp-admin/upload.php1,465 ▲744.12 ▼0.0581.80 ▼17.5945.31 ▼0.22
Types /wp-admin/edit.php?post_type=squirrels_type2,3123.3948.8030.70
Makes /wp-admin/edit.php?post_type=squirrels_make3,6733.4050.6432.67
Models /wp-admin/edit.php?post_type=squirrels_model3,7383.4258.5940.65
Settings /wp-admin/admin.php?page=squirrels1,1853.0840.7026.68
Inventory /wp-admin/admin.php?page=squirrels_inventory1,3863.1939.6929.28
Features /wp-admin/admin.php?page=squirrels_features1,1893.1940.1727.58

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_squirrels_images
    • wp_squirrels_inventory
    • wp_squirrels_features
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • squirrels_inventory_version

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'SquirrelsInventory\\CustomPostType' not found in wp-content/plugins/squirrels-auto-inventory/classes/Make.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/squirrels-auto-inventory/classes/FeatureTable.php on line 6
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/squirrels-auto-inventory/classes/FeatureTable.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'SquirrelsInventory\\Feature' not found in wp-content/plugins/squirrels-auto-inventory/includes/features.php:4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/squirrels-auto-inventory/classes/AutoTable.php on line 6
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/squirrels-auto-inventory/includes/public_inventory.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_custom() in wp-content/plugins/squirrels-auto-inventory/includes/model_meta.php:4
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/squirrels-auto-inventory/classes/AutoTable.php on line 6
    • > PHP Fatal error
      Uncaught Error: Class 'SquirrelsInventory\\CustomPostType' not found in wp-content/plugins/squirrels-auto-inventory/classes/AutoType.php:9
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/squirrels-auto-inventory/classes/AutoTable.php on line 6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 90% 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
Attributes that need to be fixed: The official readme.txt might help

squirrels-auto-inventory/squirrels_inventory.php 85% from 13 tests

The main PHP script in "Squirrels Auto Inventory" version 1.0.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("squirrels-auto-inventory.php" instead of "squirrels_inventory.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
Everything looks great! No dangerous files found in this plugin5,407 lines of code in 26 files:
LanguageFilesBlank linesComment linesLines of code
PHP197867983,821
CSS41031,207
JavaScript2627378
JSON1001

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity24.00
▷ Minimum class complexity1.00
▷ Maximum class complexity88.00
Average method complexity2.34
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods205
▷ Static methods104.88%
▷ Public methods19796.10%
▷ Protected methods20.98%
▷ Private methods62.93%
Functions8
▷ Named functions00.00%
▷ Anonymous functions8100.00%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin