10% smartbroker

Code Review | SmartBroker

WordPress plugin SmartBroker scored10%from 54 tests.

About plugin

  • Plugin page: smartbroker
  • Plugin version: 6.3.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3.0-4.9
  • WordPress version: 6.3.1
  • First release: Apr 19, 2012
  • Latest release: Jun 23, 2019
  • Number of updates: 176
  • Update frequency: every 14.9 days
  • Top authors: phuvf (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,191 total downloads

Benchmarks

Plugin footprint 57% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/smartbroker/xml_helpers.php+122
    array_key_exists() expects parameter 2 to be array, null given

Server metrics [RAM: ▲0.24MB] [CPU: ▼6.54ms] Passed 4 tests

A check of server-side resources used by SmartBroker
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2228.08 ▼11.93
Dashboard /wp-admin3.56 ▲0.2549.52 ▲3.11
Posts /wp-admin/edit.php3.67 ▲0.3146.18 ▼5.59
Add New Post /wp-admin/post-new.php6.14 ▲0.2594.36 ▼10.21
Media Library /wp-admin/upload.php3.48 ▲0.2536.16 ▲1.59
SmartBroker /wp-admin/options-general.php?page=smartbroker3.4232.66

Server storage [IO: ▲1.60MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • There were 2 files (0.13KB) illegally modified outside of "wp-content/plugins/smartbroker/" and "wp-content/uploads/"
    • (new file) sb_sitemap.xml
    • (new file) robots.txt
Filesystem: 42 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
sb_plugin_options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
sb_sitemap_last_refresh
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for SmartBroker
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,944 ▲17313.80 ▼0.6514.04 ▲12.2643.33 ▲2.98
Dashboard /wp-admin2,207 ▲194.85 ▼0.0296.57 ▼13.7141.34 ▼9.18
Posts /wp-admin/edit.php2,093 ▲42.07 ▼0.1136.78 ▼5.0131.54 ▼4.17
Add New Post /wp-admin/post-new.php1,517 ▼717.57 ▼5.44615.07 ▼52.1855.66 ▼0.87
Media Library /wp-admin/upload.php1,392 ▲14.21 ▲0.0195.27 ▼3.3940.97 ▼2.78
SmartBroker /wp-admin/options-general.php?page=smartbroker9442.2123.8331.58

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 did not uninstall successfully, leaving 8 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • sb_plugin_options
    • can_compress_scripts
    • widget_recent-posts
    • sb_sitemap_last_refresh

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=smartbroker
    • > Notice in wp-content/plugins/smartbroker/config.php+65
    Undefined index: zero_value

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/smartbroker/find_out_more.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_sidebar_widget() in wp-content/plugins/smartbroker/sb_widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_register_sidebar_widget() in wp-content/plugins/smartbroker/sb_widgets.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/smartbroker/create_sitemap.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (The search box and results page), #2 (A sample boat listing with broker's notes, specifications, photos, videos and contact form), #3 (The featured boats shortcode), #4 (Adding the SmartBroker search widget to a sidebar (with default size and price values)), #5 (A sample homepage showing the featured boats shortcode as well as the search widget), #6 (SmartBroker Server v6: Editing a listing)
The official readme.txt is a good inspiration

smartbroker/smartbroker.php Passed 13 tests

The primary PHP file in "SmartBroker" version 6.3.0.4 is used by WordPress to initiate all plugin functionality
57 characters long description:
A plugin to insert SmartBroker data into a Wordpress site

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected1,958 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP152271791,338
JavaScript56931414
CSS25917206

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods1
▷ Static methods00.00%
▷ Public methods1100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
8 PNG files occupy 0.09MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/video-overlay.png2.42KB1.59KB▼ 34.21%
images/logo.png19.26KB5.76KB▼ 70.11%
images/icon-prev.png15.26KB5.09KB▼ 66.61%
images/icon-close.png16.21KB7.33KB▼ 54.75%
images/vr-overlay.png7.61KB3.51KB▼ 53.88%