78% smartarget-button-builder

Code Review | Smartarget Button Builder

WordPress plugin Smartarget Button Builder scored78%from 54 tests.

About plugin

  • Plugin page: smartarget-button...
  • Plugin version: 1.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3
  • WordPress version: 6.3.1
  • First release: Nov 17, 2021
  • Latest release: Aug 9, 2023
  • Number of updates: 20
  • Update frequency: every 31.6 days
  • Top authors: erezs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /388 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼0.74ms] Passed 4 tests

A check of server-side resources used by Smartarget Button Builder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0340.11 ▲4.26
Dashboard /wp-admin3.32 ▲0.0249.69 ▲0.46
Posts /wp-admin/edit.php3.37 ▲0.0247.70 ▲0.62
Add New Post /wp-admin/post-new.php5.92 ▲0.0491.47 ▼8.28
Media Library /wp-admin/upload.php3.25 ▲0.0241.43 ▲8.23
Smartarget Button Builder /wp-admin/options-general.php?page=smartarget_button_builder3.2435.02

Server storage [IO: ▲3.69MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Smartarget Button Builder
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,907 ▲17221.19 ▲6.699.00 ▲7.0643.50 ▼4.43
Dashboard /wp-admin2,210 ▲2210.97 ▲6.00194.42 ▲81.7941.84 ▼2.47
Posts /wp-admin/edit.php2,105 ▲167.28 ▲5.28110.07 ▲68.6132.25 ▼5.16
Add New Post /wp-admin/post-new.php1,682 ▲14028.14 ▲9.98662.81 ▲59.5963.43 ▲0.87
Media Library /wp-admin/upload.php1,398 ▲139.64 ▲5.36189.62 ▲90.7844.92 ▲2.26
Smartarget Button Builder /wp-admin/options-general.php?page=smartarget_button_builder4,0987.60219.49285.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/smartarget-button-builder/public/partials/smartarget-button-builder-public-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/smartarget-button-builder/admin/partials/smartarget-button-builder-admin-display.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: action, support, smartarget, contact, sale...

smartarget-button-builder/smartarget-button-builder.php 92% from 13 tests

The main PHP script in "Smartarget Button Builder" version 1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

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
Success! There were no dangerous files found in this plugin861 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript654,362635
PHP12130522225
CSS2041

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity2.00
▷ Minimum class complexity1.00
▷ Maximum class complexity5.00
Average method complexity1.25
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2382.14%
▷ Protected methods00.00%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin