72% custom-business-locations

Code Review | Custom Business Locations

WordPress plugin Custom Business Locations scored72%from 54 tests.

About plugin

  • Plugin page: custom-business-l...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5
  • WordPress version: 6.3.1
  • First release: Jun 4, 2013
  • Latest release: Jul 5, 2013
  • Number of updates: 11
  • Update frequency: every 2.8 days
  • Top authors: tatemz (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

20+ active /3,485 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.23MB] [CPU: ▼25.52ms] Passed 4 tests

An overview of server-side resources used by Custom Business Locations
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0335.73 ▼1.75
Dashboard /wp-admin3.07 ▼0.2724.73 ▼32.57
Posts /wp-admin/edit.php3.21 ▼0.1529.42 ▼16.79
Add New Post /wp-admin/post-new.php5.45 ▼0.4365.47 ▼42.44
Media Library /wp-admin/upload.php3.16 ▼0.0724.59 ▼10.27
Custom Business Locations /wp-admin/options-general.php?page=custom_business_locations3.1929.60

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 79 new files
Database: no new tables, 8 new options
New WordPress options
cbl_plugin_version
widget_recent-comments
widget_recent-posts
cbl_plugin_options
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded

Browser metrics Passed 4 tests

Custom Business Locations: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲20014.60 ▲0.1828.42 ▲26.7836.84 ▼2.84
Dashboard /wp-admin2,210 ▲195.77 ▼0.12101.84 ▲3.3236.98 ▼6.56
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0133.10 ▼6.8033.90 ▼2.80
Add New Post /wp-admin/post-new.php1,545 ▲2618.23 ▼5.04615.39 ▲24.8057.47 ▼4.85
Media Library /wp-admin/upload.php1,395 ▲44.18 ▼0.0293.92 ▼6.8242.87 ▼3.99
Custom Business Locations /wp-admin/options-general.php?page=custom_business_locations9133.6269.3549.92

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • cbl_plugin_version
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • cbl_plugin_options

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
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=custom_business_locations
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=custom_business_locations
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-business-locations/library/php/frontend/frontend-init.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/custom-business-locations/library/php/admin/admin-init.php:49

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/options-general.php?page=custom_business_locations
    • > Console-api (warning) in unknown
    https://maps.googleapis.com/maps/api/js?key&sensor=true&ver=6.3.1 210: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/options-general.php?page=custom_business_locations
    • > Javascript (severe) in unknown
    /wp-content/plugins/custom-business-locations/library/js/admin.min.js?ver=6.3.1 0:665 Uncaught TypeError: e(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Plugin Name: You should set the name of your plugin on the first line ( === custom-business-locations === )
  • Screenshots: Screenshot #1 (Custom Google map display with custom notices, hours of operation, and contact information.) image missing
You can take inspiration from this readme.txt

custom-business-locations/custom-business-locations.php Passed 13 tests

"Custom Business Locations" version 1.1.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
79 characters long description:
Add your business's locations and display a custom Google map with a shortcode.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin2,075 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP6132262891
JavaScript1118571873
Sass327872,544299
Ruby183510
CSS2002

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity20.75
▷ Minimum class complexity7.00
▷ Maximum class complexity28.00
Average method complexity3.82
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods28100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
1 PNG file occupies 0.41MB with 0.28MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png423.54KB136.88KB▼ 67.68%