63% business-listing

Code Review | Business Listing

WordPress plugin Business Listing scored63%from 54 tests.

About plugin

  • Plugin page: business-listing
  • Plugin version: 2.1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: May 14, 2021
  • Latest release: Dec 10, 2022
  • Number of updates: 11
  • Update frequency: every 52.4 days
  • Top authors: falcon13 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /452 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼10.44ms] Passed 4 tests

An overview of server-side resources used by Business Listing
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.70 ▼2.82
Dashboard /wp-admin3.44 ▲0.1056.75 ▼10.71
Posts /wp-admin/edit.php3.56 ▲0.2053.15 ▼0.29
Add New Post /wp-admin/post-new.php6.02 ▲0.1384.25 ▼27.92
Media Library /wp-admin/upload.php3.34 ▲0.1139.32 ▲1.44
Add Region /wp-admin/admin.php?page=business-listings-add-region3.3134.17
Options /wp-admin/admin.php?page=business-listings-options3.3538.84
Regions /wp-admin/admin.php?page=business-listings-regions3.3735.62
List /wp-admin/admin.php?page=business-listings3.3638.89
Categories /wp-admin/admin.php?page=business-listings-categories3.3738.58
Add/Edit /wp-admin/admin.php?page=business-listings-edit3.3836.06
Add Category /wp-admin/admin.php?page=business-listings-add-category3.3135.28

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 25 new files
Database: 3 new tables, 6 new options
New tables
wp_otgblist_categories
wp_otgblist_regions
wp_otgblist_listings
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Business Listing
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,082 ▲32115.47 ▲1.535.75 ▲4.1440.96 ▼0.05
Dashboard /wp-admin2,376 ▲2026.49 ▲0.84124.71 ▲34.3639.76 ▼4.81
Posts /wp-admin/edit.php2,307 ▲2073.75 ▲1.7757.02 ▲20.0329.80 ▼3.56
Add New Post /wp-admin/post-new.php1,563 ▲3423.22 ▲0.06657.55 ▲7.2935.08 ▼22.26
Media Library /wp-admin/upload.php1,441 ▲474.34 ▲0.1693.95 ▼10.1149.77 ▲1.94
Add Region /wp-admin/admin.php?page=business-listings-add-region7191.9221.3717.85
Options /wp-admin/admin.php?page=business-listings-options1,0903.3250.4328.73
Regions /wp-admin/admin.php?page=business-listings-regions1,2483.9266.1940.08
List /wp-admin/admin.php?page=business-listings1,2364.0072.6434.97
Categories /wp-admin/admin.php?page=business-listings-categories1,2453.9562.7131.83
Add/Edit /wp-admin/admin.php?page=business-listings-edit1,0723.2847.9026.20
Add Category /wp-admin/admin.php?page=business-listings-add-category7191.7322.9217.83

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_otgblist_listings
    • wp_otgblist_regions
    • wp_otgblist_categories
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=business-listings-edit
    • > Notice in wp-content/plugins/business-listing/helpers/validation_helper.php+34
    Undefined index: listing_id

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/business-listing/views/about.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgblist_display_messages() in wp-content/plugins/business-listing/views/listing_edit.php:12
    • > PHP Warning
      Use of undefined constant OTGBLIST_ROOT_PATH - assumed 'OTGBLIST_ROOT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/business-listing/views/options.php on line 13
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/business-listing/business-listing.php on line 15
    • > PHP Warning
      include(): Failed opening 'OTGBLIST_ROOT_PATHviews/about.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/business-listing/views/options.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/business-listing/views/options.php:16
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/business-listing/business-listing.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgblist_display_messages() in wp-content/plugins/business-listing/views/categories.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function otgblist_display_messages() in wp-content/plugins/business-listing/views/list.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/business-listing/business-listing.php:18
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/business-listing/business-listing.php on line 17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration Passed 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: business, shortcode, thumbnail, business directory, listings

business-listing/business-listing.php Passed 13 tests

The main PHP file in "Business Listing" ver. 2.1.2 adds more information about the plugin and also serves as the entry point for this plugin
64 characters long description:
List businesses in tiles with a photo and link in a random order

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
There were no executable files found in this plugin1,371 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP131403701,124
CSS31824177
JavaScript3144970

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.50
▷ Minimum class complexity6.00
▷ Maximum class complexity19.00
Average method complexity2.21
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sort_desc.png0.15KB0.25KB0.00%
images/sort_asc_disabled.png0.14KB0.25KB0.00%
images/sort_asc.png0.16KB0.25KB0.00%
images/sort_desc_disabled.png0.14KB0.25KB0.00%
images/sort_both.png0.20KB0.29KB0.00%