72% smart-popup

Code Review | Smart Popup

WordPress plugin Smart Popup scored72%from 54 tests.

About plugin

  • Plugin page: smart-popup
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.1
  • WordPress version: 6.3.1
  • First release: Jul 19, 2018
  • Latest release: Sep 1, 2018
  • Number of updates: 6
  • Update frequency: every 7.5 days
  • Top authors: naminbd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,034 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.18MB] [CPU: ▼19.97ms] Passed 4 tests

Analyzing server-side resources used by Smart Popup
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1223.86 ▼13.96
Dashboard /wp-admin3.45 ▲0.1545.08 ▼6.53
Posts /wp-admin/edit.php3.57 ▲0.2149.89 ▲0.47
Add New Post /wp-admin/post-new.php4.74 ▼1.1442.70 ▼58.41
Media Library /wp-admin/upload.php3.37 ▲0.1533.86 ▼0.99
Smart Popup /wp-admin/edit.php?post_type=wps-popup3.4235.08
How to Use /wp-admin/edit.php?post_type=wps-popup&page=how_to_use3.3430.72
Add New /wp-admin/post-new.php?post_type=wps-popup3.4038.95
Setting /wp-admin/edit.php?post_type=wps-popup&page=global_settings3.3631.92
Theme /wp-admin/edit.php?post_type=wps-popup&page=theme3.3431.63

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 54 new files
Database: no new tables, 8 new options
New WordPress options
wpsp_active_theme
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
wpsp_global_settings
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Smart Popup
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,989 ▲24314.00 ▼0.388.45 ▲6.8138.28 ▼4.31
Dashboard /wp-admin2,263 ▲755.24 ▼0.66115.92 ▲4.9741.18 ▼6.97
Posts /wp-admin/edit.php2,136 ▲442.33 ▲0.3242.01 ▲0.3337.10 ▲0.36
Add New Post /wp-admin/post-new.php1,573 ▲4323.49 ▲5.03651.84 ▲17.0130.16 ▼24.92
Media Library /wp-admin/upload.php1,449 ▲674.34 ▲0.1990.96 ▼8.4043.27 ▲0.38
Smart Popup /wp-admin/edit.php?post_type=wps-popup1,1132.4432.8528.34
How to Use /wp-admin/edit.php?post_type=wps-popup&page=how_to_use8751.8730.8939.60
Add New /wp-admin/post-new.php?post_type=wps-popup2,8938.55201.88157.01
Setting /wp-admin/edit.php?post_type=wps-popup&page=global_settings1,1062.4241.3328.83
Theme /wp-admin/edit.php?post_type=wps-popup&page=theme9441.9728.5959.74

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
The following items require your attention
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • wpsp_active_theme
    • can_compress_scripts
    • wpsp_global_settings

Smoke tests 25% 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
  • 16 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=wps-popup
    • > Notice in wp-content/plugins/smart-popup/view/admin/template/forms/popup-settings.php+55
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wps-popup&page=global_settings
    • > Notice in wp-content/plugins/smart-popup/view/settings.php+72
    Undefined index: hide_in_excerpt
    • > GET request to /wp-admin/edit.php?post_type=wps-popup&page=global_settings
    • > Notice in wp-content/plugins/smart-popup/view/settings.php+99
    Undefined index: popup_custom_width

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/smart-popup/view/admin/template/forms/popup-settings.php
    • > /wp-content/plugins/smart-popup/view/frontend/popup-type/image.php
    • > /wp-content/plugins/smart-popup/view/admin/template/forms/pro.php
    • > /wp-content/plugins/smart-popup/view/admin/template/popup_type_select.php
    • > /wp-content/plugins/smart-popup/view/admin/template/forms/shortcode.php
    • > /wp-content/plugins/smart-popup/view/admin/template/forms/image.php
  • 58× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/smart-popup/view/admin/template/forms/popup-settings.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/smart-popup/smart-popup.php:63
    • > PHP Notice
      Undefined variable: id in wp-content/plugins/smart-popup/view/frontend/popup.php on line 4
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/smart-popup/view/admin/template/popup_type_select.php on line 30
    • > PHP Warning
      Use of undefined constant WPSP_URL - assumed 'WPSP_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/smart-popup/view/admin/template/popup_type_select.php on line 7
    • > PHP Notice
      Undefined variable: metadata in wp-content/plugins/smart-popup/view/admin/template/popup_type_select.php on line 17
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/smart-popup/view/frontend/popup.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-popup/view/admin/template/forms/popup-settings.php on line 25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-popup/view/admin/template/forms/popup-settings.php on line 45
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/smart-popup/view/frontend/popup-type/image.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 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
8 plugin tags: modal, popup, video popup, facebook popup, shortcode popup...

smart-popup/smart-popup.php 92% from 13 tests

The principal PHP file in "Smart Popup" v. 1.0.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected1,873 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP19293401,074
CSS6968427
SVG606268
JavaScript1406104

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity69.00
▷ Minimum class complexity69.00
▷ Maximum class complexity69.00
Average method complexity3.19
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods31
▷ Static methods13.23%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
11 PNG files occupy 0.34MB with 0.22MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png67.79KB17.78KB▼ 73.77%
assets/pro/popupsettings_customize.png45.54KB11.76KB▼ 74.17%
assets/images/close_black.png0.68KB0.47KB▼ 30.12%
assets/screenshot-3.png41.49KB9.46KB▼ 77.19%
assets/screenshot-2.png64.21KB17.69KB▼ 72.46%