78% popupsmart

Code Review | Popupsmart

WordPress plugin Popupsmart scored78%from 54 tests.

About plugin

  • Plugin page: popupsmart
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.2.2
  • WordPress version: 6.3.1
  • First release: Feb 26, 2020
  • Latest release: Oct 6, 2023
  • Number of updates: 17
  • Update frequency: every 77.5 days
  • Top authors: popupsmart (100%)

Code review

54 tests

User reviews

1 review

Install metrics

500+ active /3,428 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.21ms] Passed 4 tests

This is a short check of server-side resources used by Popupsmart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0337.97 ▼6.39
Dashboard /wp-admin3.34 ▲0.0347.64 ▼0.27
Posts /wp-admin/edit.php3.39 ▲0.0352.43 ▼1.44
Add New Post /wp-admin/post-new.php5.94 ▲0.0597.02 ▼4.35
Media Library /wp-admin/upload.php3.26 ▲0.0335.69 ▼0.64

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
popupsmart_account_id
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Popupsmart
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,898 ▲11213.78 ▼0.787.78 ▲5.4835.65 ▼11.05
Dashboard /wp-admin2,209 ▲295.56 ▼0.0484.53 ▼11.5079.19 ▲39.03
Posts /wp-admin/edit.php2,126 ▲231.94 ▼0.0739.86 ▼1.0435.10 ▼1.48
Add New Post /wp-admin/post-new.php1,546 ▲1823.22 ▲0.10673.88 ▲41.0848.83 ▼14.24
Media Library /wp-admin/upload.php1,429 ▲324.18 ▲0.01101.31 ▼4.8470.72 ▲19.18

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • popupsmart_account_id

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
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/popupsmart/public/partials/pop-public-display.php
  • 5× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Notice
      Undefined variable: pluginPath in wp-content/plugins/popupsmart/admin/partials/pop-admin-display.php on line 21
    • > PHP Notice
      Undefined variable: pluginPath in wp-content/plugins/popupsmart/admin/partials/pop-admin-display.php on line 25
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/popupsmart/admin/partials/pop-admin-field-text.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/popupsmart/admin/partials/pop-admin-display.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/popupsmart/admin/partials/pop-admin-field-dropdown.php:16

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 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === popupsmart === )
You can look at the official readme.txt

popupsmart/pop.php 85% from 13 tests

The main file in "Popupsmart" v. 2.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("popupsmart.php" instead of "pop.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
No dangerous file extensions were detected603 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP15164581370
CSS2538214
SVG40013
JavaScript24546

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity2.29
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.27
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods33
▷ Static methods26.06%
▷ Public methods2884.85%
▷ Protected methods00.00%
▷ Private methods515.15%
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

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin