77% ays-popup-box

Code Review | Popup Box - Best WordPress Popup Plugin

WordPress plugin Popup Box - Best WordPress Popup Plugin scored77%from 54 tests.

About plugin

  • Plugin page: ays-popup-box
  • Plugin version: 3.9.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.4.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2018
  • Latest release: Nov 30, 2023
  • Number of updates: 629
  • Update frequency: every 3.2 days
  • Top authors: ays-pro (100%)

Code review

54 tests

User reviews

51 reviews

Install metrics

20,000+ active /745,296 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.52MB] [CPU: ▲6.86ms] Passed 4 tests

This is a short check of server-side resources used by Popup Box - Best WordPress Popup Plugin
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /6.71 ▲3.2553.85 ▲13.65
Dashboard /wp-admin4.79 ▲1.4971.68 ▲21.45
Posts /wp-admin/edit.php4.83 ▲1.4762.62 ▲13.18
Add New Post /wp-admin/post-new.php7.50 ▲1.6288.93 ▼9.46
Media Library /wp-admin/upload.php4.75 ▲1.5243.69 ▲10.05
Popups /wp-admin/admin.php?page=ays-pb4.8351.90
Categories /wp-admin/admin.php?page=ays-pb-categories4.8161.19
Custom Fields /wp-admin/admin.php?page=ays-pb-attributes4.8051.19
Export/Import /wp-admin/admin.php?page=ays-pb-export-import4.8060.16
How to use /wp-admin/admin.php?page=ays-pb-how-to-use4.8041.41
Our Products /wp-admin/admin.php?page=ays-pb-featured-plugins4.8043.71
Analytics /wp-admin/admin.php?page=ays-pb-reports4.8052.38
PRO Features /wp-admin/admin.php?page=ays-pb-pb-features4.9548.07
Submissions /wp-admin/admin.php?page=ays-pb-subscribes4.8048.85
General Settings /wp-admin/admin.php?page=ays-pb-settings4.8948.66

Server storage [IO: ▲6.04MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 217 new files
Database: 3 new tables, 10 new options
New tables
wp_ays_pb_settings
wp_ays_pb_categories
wp_ays_pb
New WordPress options
ays_pb_banner_time
theysaidso_admin_options
ays_pb_db_version
widget_recent-posts
db_upgraded
widget_theysaidso_widget
ays_pb_sale_btn
ays_pb_sale_dismiss_for_two_month_spring
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Popup Box - Best WordPress Popup Plugin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,171 ▲40913.94 ▼0.4114.71 ▲12.8438.59 ▼6.68
Dashboard /wp-admin2,253 ▲795.55 ▼0.01105.38 ▲17.0098.10 ▲55.89
Posts /wp-admin/edit.php2,173 ▲732.01 ▼0.0237.04 ▼4.7732.59 ▼2.10
Add New Post /wp-admin/post-new.php1,586 ▲6023.10 ▲0.16664.82 ▼0.4651.35 ▼0.82
Media Library /wp-admin/upload.php1,473 ▲794.16 ▼0.0194.90 ▼0.2763.83 ▲23.78
Popups /wp-admin/admin.php?page=ays-pb2,79714.74349.10155.77
Categories /wp-admin/admin.php?page=ays-pb-categories2,0345.8499.30109.04
Custom Fields /wp-admin/admin.php?page=ays-pb-attributes2,13716.11318.2188.69
Export/Import /wp-admin/admin.php?page=ays-pb-export-import1,7755.7868.1965.65
How to use /wp-admin/admin.php?page=ays-pb-how-to-use1,8165.7472.4578.02
Our Products /wp-admin/admin.php?page=ays-pb-featured-plugins1,8375.7968.8271.87
Analytics /wp-admin/admin.php?page=ays-pb-reports1,6885.7270.9469.73
PRO Features /wp-admin/admin.php?page=ays-pb-pb-features2,9825.7569.9883.64
Submissions /wp-admin/admin.php?page=ays-pb-subscribes1,6555.8064.0768.62
General Settings /wp-admin/admin.php?page=ays-pb-settings3,2246.0274.0186.26

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 9 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • ays_pb_banner_time
    • widget_recent-posts
    • widget_recent-comments
    • ays_pb_sale_btn
    • ays_pb_sale_dismiss_for_two_month_spring
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ays-popup-box/public/partials/ays-pb-public-display.php
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ays-popup-box/admin/partials/how-to-use/ays-pb-how-to-use.php:9
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/ays-popup-box/admin/partials/settings/popup-box-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ays-popup-box/admin/partials/attributes/actions/ays-pb-attributes-actions.php:3
    • > PHP Warning
      Use of undefined constant AYS_PB_ADMIN_URL - assumed 'AYS_PB_ADMIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/ays-popup-box/admin/partials/ays-pb-categories-display.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ays-popup-box/admin/partials/reports/ays-pb-reports-display.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ays-popup-box/admin/partials/export-import/ays-pb-export-import.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/ays-popup-box/includes/lists/class-ays-pb-list-table.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ays-popup-box/admin/partials/ays-pb-categories-display.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/ays-popup-box/admin/partials/features/ays-pb-plugin-featured-display.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/ays-popup-box/includes/lists/class-ays-pb-popup-categories-list-table.php:3

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

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: lead generation, marketing, exit popup, modal popup, pop up...

ays-popup-box/ays-pb.php 92% from 13 tests

The main PHP script in "Popup Box - Best WordPress Popup Plugin" version 3.9.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("ays-popup-box.php" instead of "ays-pb.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin34,559 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP312,3441,86018,398
CSS131,4882,4496,518
PO File32,1643,3715,659
JavaScript115115653,622
SVG721020362

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 1,544)
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 315)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity180.07
▷ Minimum class complexity1.00
▷ Maximum class complexity1,544.00
Average method complexity13.32
▷ Minimum method complexity1.00
▷ Maximum method complexity315.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes15
▷ Abstract classes00.00%
▷ Concrete classes15100.00%
▷ Final classes00.00%
Methods218
▷ Static methods3616.51%
▷ Public methods20694.50%
▷ Protected methods20.92%
▷ Private methods104.59%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
68 PNG files occupy 1.30MB with 0.37MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/remove-hover.png2.58KB2.55KB▼ 1.36%
admin/images/integrations/sendgrid_logo.png0.49KB0.45KB▼ 8.80%
admin/images/avatars/personal_avatar.png19.02KB7.39KB▼ 61.18%
admin/images/avatars/pro_avatar.png22.69KB8.75KB▼ 61.46%
admin/images/integrations/mailerlite.png1.25KB1.11KB▼ 10.86%