78% autostock

Code Review | Autostock

WordPress plugin Autostock scored78%from 54 tests.

About plugin

  • Plugin page: autostock
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-4.2.2
  • WordPress version: 6.3.1
  • First release: Jan 4, 2015
  • Latest release: May 14, 2015
  • Number of updates: 15
  • Update frequency: every 8.8 days
  • Top authors: dollar_dad (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active /3,180 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.34MB] [CPU: ▼4.34ms] Passed 4 tests

A check of server-side resources used by Autostock
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2246.43 ▲5.03
Dashboard /wp-admin3.67 ▲0.3752.07 ▲2.48
Posts /wp-admin/edit.php3.78 ▲0.4348.37 ▼0.80
Add New Post /wp-admin/post-new.php6.28 ▲0.3991.91 ▼20.55
Media Library /wp-admin/upload.php3.59 ▲0.3738.38 ▲1.50
Add Car /wp-admin/post-new.php?post_type=cars3.6347.81
Car Types /wp-admin/edit-tags.php?taxonomy=car_types&post_type=cars3.5939.11
Car Features Settings /wp-admin/admin.php?page=car_features_setting3.5640.78
Autostock /wp-admin/admin.php?page=autostock_admin_settings3.5636.47
All Cars /wp-admin/edit.php?post_type=cars3.6436.66
Car Features /wp-admin/edit-tags.php?taxonomy=car_features&post_type=cars3.5939.27
Makes and Models /wp-admin/edit-tags.php?taxonomy=car_make_model&post_type=cars3.5937.99

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Autostock
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,888 ▲12713.19 ▼1.195.95 ▲4.2540.95 ▼2.63
Dashboard /wp-admin2,294 ▲915.86 ▲0.00101.65 ▲0.6841.35 ▲4.77
Posts /wp-admin/edit.php2,170 ▲732.03 ▼0.0036.75 ▼2.7734.20 ▼1.30
Add New Post /wp-admin/post-new.php1,584 ▲4417.75 ▼0.65677.22 ▲62.4450.17 ▼13.50
Media Library /wp-admin/upload.php1,473 ▲704.25 ▲0.0198.50 ▼4.7442.99 ▲1.09
Add Car /wp-admin/post-new.php?post_type=cars2,8138.16182.6273.50
Car Types /wp-admin/edit-tags.php?taxonomy=car_types&post_type=cars1,3192.1643.6148.94
Car Features Settings /wp-admin/admin.php?page=car_features_setting8622.0824.2329.05
Autostock /wp-admin/admin.php?page=autostock_admin_settings9021.7226.7631.77
All Cars /wp-admin/edit.php?post_type=cars1,1591.9829.5727.88
Car Features /wp-admin/edit-tags.php?taxonomy=car_features&post_type=cars1,3442.1628.1830.93
Makes and Models /wp-admin/edit-tags.php?taxonomy=car_make_model&post_type=cars1,3442.1629.3330.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget

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
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=cars
    • > Notice in wp-content/plugins/autostock/includes/Car_Post_Type.php+319
    Trying to access array offset on value of type bool
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=cars
    • > Warning in wp-content/plugins/autostock/includes/Car_Post_Type.php+329
    Illegal string offset 'vehicle_year'
  • 21 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=cars
    • > Notice in wp-content/plugins/autostock/includes/Car_Post_Type.php+329
    Uninitialized string offset: 0

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Autostock\\AdminSettings\\get_option() in wp-content/plugins/autostock/includes/admin_settings.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Autostock\\register_activation_hook() in wp-content/plugins/autostock/autostock.php:46
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Autostock\\CarPostType\\_x() in wp-content/plugins/autostock/includes/Car_Post_Type.php:42

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: car sales, car dealer, automotive, auto dealer, car lots

autostock/autostock.php 85% from 13 tests

The entry point to "Autostock" version 1.0.4 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Domain Path: The domain path must begin with a forward slash character ("/locale")
  • Domain Path: You should use only dashes and lowercase characters for the domain path ("locale")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected790 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP3164172762
JavaScript13018
CSS10010

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.28
Average class complexity44.50
▷ Minimum class complexity32.00
▷ Maximum class complexity57.00
Average method complexity4.11
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2692.86%
▷ Protected methods00.00%
▷ Private methods27.14%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There are no PNG files in this plugin