78% smartarget-message-bar

Code Review | Smartarget Message Bar

WordPress plugin Smartarget Message Bar scored78%from 54 tests.

About plugin

  • Plugin page: smartarget-messag...
  • 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: Sep 25, 2021
  • Latest release: Aug 9, 2023
  • Number of updates: 12
  • Update frequency: every 57.0 days
  • Top authors: erezs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /387 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
Install script ran successfully

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.34ms] Passed 4 tests

This is a short check of server-side resources used by Smartarget Message Bar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0745.91 ▲6.32
Dashboard /wp-admin3.37 ▲0.0751.93 ▼5.02
Posts /wp-admin/edit.php3.48 ▲0.1349.84 ▼1.23
Add New Post /wp-admin/post-new.php5.97 ▲0.0895.79 ▼4.96
Media Library /wp-admin/upload.php3.29 ▲0.0639.13 ▲1.86
Smartarget Message Bar /wp-admin/options-general.php?page=smartarget_message_bar3.2633.53

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Smartarget Message Bar
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,896 ▲13520.98 ▲7.019.82 ▲8.0342.52 ▼1.56
Dashboard /wp-admin2,202 ▲2510.65 ▲4.98164.63 ▲70.9740.52 ▼5.93
Posts /wp-admin/edit.php2,119 ▲227.24 ▲5.25116.97 ▲77.9134.12 ▼0.97
Add New Post /wp-admin/post-new.php1,573 ▲4529.59 ▲6.54643.88 ▼59.8854.40 ▲1.82
Media Library /wp-admin/upload.php1,407 ▲109.41 ▲5.33192.69 ▲91.1645.46 ▲0.49
Smartarget Message Bar /wp-admin/options-general.php?page=smartarget_message_bar1,6189.24156.13157.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/smartarget-message-bar/public/partials/smartarget-message-bar-public-display.php
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_home_url() in wp-content/plugins/smartarget-message-bar/admin/partials/smartarget-message-bar-admin-display.php:20

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: popup, cookie, announcement, sale, message

smartarget-message-bar/smartarget-message-bar.php 92% from 13 tests

The entry point to "Smartarget Message Bar" version 1.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected868 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript654,369642
PHP12130522225
CSS2041

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin