77% ascsoftw-store-locator

Code Review | Store Locator

WordPress plugin Store Locator scored77%from 54 tests.

About plugin

  • Plugin page: ascsoftw-store-lo...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Oct 14, 2019
  • Latest release: Nov 22, 2019
  • Number of updates: 8
  • Update frequency: every 5.0 days
  • Top authors: ascsoftw (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /574 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.05MB] [CPU: ▲3.27ms] Passed 4 tests

Analyzing server-side resources used by Store Locator
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.02 ▲0.5642.60 ▼15.10
Dashboard /wp-admin4.55 ▲1.2562.97 ▲12.66
Posts /wp-admin/edit.php4.57 ▲1.2265.88 ▲15.18
Add New Post /wp-admin/post-new.php7.14 ▲1.25106.44 ▲0.44
Media Library /wp-admin/upload.php4.41 ▲1.1847.97 ▲15.09
Category /wp-admin/edit-tags.php?taxonomy=ascsoftw_sl&post_type=ascsoftw_sl4.4146.22
Add New /wp-admin/post-new.php?post_type=ascsoftw_sl4.8258.22
All Stores /wp-admin/edit.php?post_type=ascsoftw_sl4.5255.26
Store Locator Settings /wp-admin/edit.php?post_type=ascsoftw_sl&page=ascsoftw_sl4.3845.26

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 394 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Store Locator
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,851 ▲10513.40 ▼0.901.81 ▼0.0038.05 ▼3.80
Dashboard /wp-admin2,252 ▲644.96 ▼0.85108.43 ▼7.0538.65 ▼3.96
Posts /wp-admin/edit.php2,138 ▲492.09 ▲0.0540.70 ▲2.1634.66 ▼0.03
Add New Post /wp-admin/post-new.php1,550 ▲823.24 ▲4.89635.36 ▼19.8758.50 ▼3.32
Media Library /wp-admin/upload.php1,437 ▲494.31 ▲0.0897.54 ▲1.4541.49 ▼1.56
Category /wp-admin/edit-tags.php?taxonomy=ascsoftw_sl&post_type=ascsoftw_sl1,2792.2128.4429.23
Add New /wp-admin/post-new.php?post_type=ascsoftw_sl2,3627.53170.69210.91
All Stores /wp-admin/edit.php?post_type=ascsoftw_sl1,1152.0850.1038.97
Store Locator Settings /wp-admin/edit.php?post_type=ascsoftw_sl&page=ascsoftw_sl1,4641.8833.5630.26

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 39× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Radio' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_Taxonomy_Radio_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_Picker_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ascsoftw-store-locator/vendor/cmb_field_map-master/cmb-field-map.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Multi_Base' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_Multi_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_File_Base' not found in wp-content/plugins/ascsoftw-store-locator/vendor/cmb2/includes/types/CMB2_Type_File_List.php:13

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=ascsoftw_sl
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key=&libraries=places 234:51 "Google Maps JavaScript API has been loaded directly without a callback. This is not supported and can lead to race conditions and suboptimal performance. For supported loading patterns please see https://goo.gle/js-api-loading"
    • > GET request to /wp-admin/post-new.php?post_type=ascsoftw_sl
    • > Console-api (severe) in unknown
    https://maps.googleapis.com/maps/api/js?key=&libraries=places 152:248 "You are using this API without a key. See https://developers.google.com/maps/documentation/javascript/error-messages?utm_source=maps_js&utm_medium=degraded&utm_campaign=billing#api-key-and-billing-errors"

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Requires at least: Version not formatted correctly
  • Donate link: Invalid URI ("paypal.me/ascsoftw")
You can take inspiration from this readme.txt

ascsoftw-store-locator/ascsoftw-sl.php 85% from 13 tests

The main PHP file in "Store Locator" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ascsoftw-store-locator.php" instead of "ascsoftw-sl.php")
  • Description: The description should be shorter than 140 characters (currently 221 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected50,855 lines of code in 226 files:
LanguageFilesBlank linesComment linesLines of code
PO File12915,40419,61834,777
PHP702,6147,0008,836
CSS151,1861,1524,789
JavaScript94085901,790
Markdown32320663

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity17.95
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.05
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes77
▷ Abstract classes810.39%
▷ Concrete classes6989.61%
▷ Final classes00.00%
Methods637
▷ Static methods8813.81%
▷ Public methods53283.52%
▷ Protected methods9114.29%
▷ Private methods142.20%
Functions39
▷ Named functions3794.87%
▷ Anonymous functions25.13%
Constants14
▷ Global constants750.00%
▷ Class constants750.00%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
15 compressed PNG files occupy 0.11MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
vendor/cmb2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
vendor/cmb2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
vendor/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%