73% wpoptin

Code Review | Top Bar - PopUps - by WPOptin

WordPress plugin Top Bar - PopUps - by WPOptin scored73%from 54 tests.

About plugin

  • Plugin page: wpoptin
  • Plugin version: 1.2.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4
  • WordPress version: 6.3.1
  • First release: Feb 14, 2020
  • Latest release: Nov 14, 2023
  • Number of updates: 73
  • Update frequency: every 19.6 days
  • Top authors: maltathemes (68.49%)DaNish Ali (32.88%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /8,259 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲5.32MB] [CPU: ▲32.92ms] 75% from 4 tests

Analyzing server-side resources used by Top Bar - PopUps - by WPOptin
It is recommended to improve the following
  • Extra RAM: The extra memory usage should kept under 5MB (currently 5.32MB on /wp-admin/admin.php?page=freemius)
PageMemory (MB)CPU Time (ms)
Home /8.90 ▲5.4475.58 ▲31.99
Dashboard /wp-admin8.92 ▲5.5881.56 ▲20.99
Posts /wp-admin/edit.php8.92 ▲5.5798.89 ▲54.77
Add New Post /wp-admin/post-new.php10.57 ▲4.69121.20 ▲29.25
Media Library /wp-admin/upload.php8.92 ▲5.6979.26 ▲49.46
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius8.9270.77

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 288 new files
Database: no new tables, 13 new options
New WordPress options
wpoptins_installDate
db_upgraded
fs_accounts
wpop_accounts_tax_children
wpop_page_id
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
fs_active_plugins
fs_debug_mode
...

Browser metrics Passed 4 tests

An overview of browser requirements for Top Bar - PopUps - by WPOptin
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲20914.27 ▼0.0144.15 ▲42.5429.69 ▼14.45
Dashboard /wp-admin2,218 ▲375.56 ▼0.2595.36 ▼22.4787.23 ▲42.36
Posts /wp-admin/edit.php2,145 ▲451.98 ▼0.0239.18 ▲4.0839.17 ▲5.55
Add New Post /wp-admin/post-new.php1,428 ▼10117.92 ▼5.28737.51 ▲101.2347.26 ▼5.72
Media Library /wp-admin/upload.php1,441 ▲414.21 ▲0.01101.36 ▲3.5377.90 ▲38.41
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1031.8025.9628.43

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/wpoptin/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 13 options
    • fs_accounts
    • wpoptins_installDate
    • can_compress_scripts
    • widget_recent-comments
    • fs_debug_mode
    • wpoptins_version
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      include(): Failed opening 'wp-content/plugins/wpoptin/frontend/assets/css/wp-load.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wpoptin/frontend/assets/css/wpoptin-customizer-style.css.php on line 7
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpoptin/frontend/assets/css/wpoptin-customizer-style.css.php on line 6
    • > PHP Warning
      include(wp-content/plugins/wpoptin/frontend/assets/css/wp-load.php): failed to open stream: No such file or directory in wp-content/plugins/wpoptin/frontend/assets/css/wpoptin-customizer-style.css.php on line 7

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

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #29, #30, #31, #32, #33 in wpoptin/assets to your readme.txt
You can look at the official readme.txt

wpoptin/wpoptin.php 92% from 13 tests

This is the main PHP file of "Top Bar - PopUps - by WPOptin" version 1.2.8, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Description: The description should be shorter than 140 characters (currently 189 characters long)

Code Analysis 97% from 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 detected59,625 lines of code in 224 files:
LanguageFilesBlank linesComment linesLines of code
PHP17410,79122,38048,250
Sass92,10325,187
JavaScript128333143,289
CSS21608161,964
SVG550781
Markdown3600154

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.57
Average class complexity58.86
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes92
▷ Abstract classes22.17%
▷ Concrete classes9097.83%
▷ Final classes00.00%
Methods1,593
▷ Static methods20813.06%
▷ Public methods1,19274.83%
▷ Protected methods191.19%
▷ Private methods38223.98%
Functions106
▷ Named functions106100.00%
▷ Anonymous functions00.00%
Constants195
▷ Global constants13870.77%
▷ Class constants5729.23%
▷ Public constants57100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.17MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/wpoptin-dark-gray-logo.png2.80KB2.65KB▼ 5.26%
assets/images/wpoptin-logo.png45.22KB48.81KB0.00%
assets/images/wpop-free-graph.png68.85KB17.76KB▼ 74.21%
assets/images/wpop-gray-logo.png2.80KB2.65KB▼ 5.23%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%