78% broadstreet

Code Review | Broadstreet

WordPress plugin Broadstreet scored78%from 54 tests.

About plugin

  • Plugin page: broadstreet
  • Plugin version: 1.46.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 17, 2012
  • Latest release: Oct 26, 2023
  • Number of updates: 130
  • Update frequency: every 31.0 days
  • Top authors: broadstreetads (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

600+ active /28,287 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.62MB] [CPU: ▼3.55ms] Passed 4 tests

An overview of server-side resources used by Broadstreet
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.21 ▲0.7544.85 ▲2.68
Dashboard /wp-admin4.03 ▲0.7249.15 ▲1.29
Posts /wp-admin/edit.php4.08 ▲0.7249.95 ▼1.86
Add New Post /wp-admin/post-new.php6.20 ▲0.3170.77 ▼16.31
Media Library /wp-admin/upload.php3.95 ▲0.7240.57 ▲6.64
Account Setup /wp-admin/admin.php?page=Broadstreet4.0339.06
Zone Options /wp-admin/admin.php?page=Broadstreet-Zone-Options3.9737.88

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 125 new files
Database: no new tables, 14 new options
New WordPress options
Broadstreet_Installed
db_upgraded
widget_bs_zones
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget
widget_bs_business_listings
widget_bs_business_categories
...

Browser metrics Passed 4 tests

Checking browser requirements for Broadstreet
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8914.59 ▲0.364.50 ▲2.8842.33 ▼0.70
Dashboard /wp-admin2,227 ▲505.55 ▼0.1189.15 ▼9.2640.65 ▼0.78
Posts /wp-admin/edit.php2,141 ▲381.98 ▼0.0238.95 ▲1.3433.82 ▼8.07
Add New Post /wp-admin/post-new.php6,318 ▲4,79125.99 ▲2.87910.12 ▲270.3766.80 ▲9.80
Media Library /wp-admin/upload.php1,441 ▲414.27 ▼0.0094.50 ▼3.3244.39 ▲0.24
Account Setup /wp-admin/admin.php?page=Broadstreet1,0381.9626.8138.35
Zone Options /wp-admin/admin.php?page=Broadstreet-Zone-Options1,9773.6783.9239.99

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 14 options in the database
    • widget_bs_sbszones
    • widget_bs_zones
    • Broadstreet_Installed_1.46.3
    • widget_bs_multiple_zones
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_bs_business_profile
    • Broadstreet_Installed
    • widget_recent-comments
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 12× PHP files perform the action of outputting non-empty strings when accessed directly (only 10 are shown):
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/admin/infoBox.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/businessMetaBox.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/admin/businessMetaBox.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Vendor/broadstreet-partner/lib/helpers/wordpress.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/infoBox.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/listings/archive/excerpt.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Vendor/broadstreet-partner/views/global/_footer.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/admin/sponsoredBox.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/admin/visibilityBox.php
    • > /wp-content/plugins/broadstreet/Broadstreet/Views/admin/global/sidebar.php
  • 101× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Broadstreet_View' not found in wp-content/plugins/broadstreet/Broadstreet/Views/admin/editable.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'Broadstreet_View' not found in wp-content/plugins/broadstreet/Broadstreet/Views/admin/admin.php:2
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/broadstreet/Broadstreet/Views/admin/businessMetaBox.php on line 155
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/broadstreet/Broadstreet/Views/admin/zones.php on line 1
    • > PHP Fatal error
      Uncaught Error: Class 'Broadstreet_Mini_Utility' not found in wp-content/plugins/broadstreet/Broadstreet/Vendor/broadstreet-partner/views/global/_header.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Broadstreet_Mini_Utility' not found in wp-content/plugins/broadstreet/Broadstreet/Vendor/broadstreet-partner/views/global/_header.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_trim_words() in wp-content/plugins/broadstreet/Broadstreet/Views/listings/archive/default.php:66
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/broadstreet/Broadstreet/Views/admin/businessMetaBox.php on line 192
    • > PHP Notice
      Undefined variable: meta in wp-content/plugins/broadstreet/Broadstreet/Views/admin/businessMetaBox.php on line 187
    • > PHP Fatal error
      Uncaught Error: Class 'Broadstreet_Utility' not found in wp-content/plugins/broadstreet/Broadstreet/Views/admin.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Plugin Name: You should set the name of your plugin on the first line ( === broadstreet === )
You can look at the official readme.txt

broadstreet/broadstreet.php Passed 13 tests

The main file in "Broadstreet" v. 1.46.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
75 characters long description:
Integrate Broadstreet business directory and adserving power into your site

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
No dangerous file extensions were detected12,868 lines of code in 79 files:
LanguageFilesBlank linesComment linesLines of code
PHP521,3251,9866,546
JavaScript136958774,263
CSS12267952,003
SQL19034
Markdown113022

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity20.47
▷ Minimum class complexity1.00
▷ Maximum class complexity187.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods266
▷ Static methods12145.49%
▷ Public methods24893.23%
▷ Protected methods103.76%
▷ Private methods83.01%
Functions38
▷ Named functions3284.21%
▷ Anonymous functions615.79%
Constants67
▷ Global constants3856.72%
▷ Class constants2943.28%
▷ Public constants29100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
34 PNG files occupy 0.84MB with 0.47MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
Broadstreet/Public/img/twitter.png4.51KB1.69KB▼ 62.41%
Broadstreet/Public/img/help/sidebar-widget.png19.77KB6.36KB▼ 67.85%
Broadstreet/Vendor/broadstreet-partner/assets/img/designer.png60.12KB43.91KB▼ 26.97%
Broadstreet/Public/img/facebook.png4.54KB1.74KB▼ 61.61%
Broadstreet/Public/img/yelp.png4.62KB1.76KB▼ 61.95%