84% pop-up

Code Review | Pop-Up Chop Chop

WordPress plugin Pop-Up Chop Chop scored84%from 54 tests.

About plugin

  • Plugin page: pop-up
  • Plugin version: 2.1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.5.1
  • WordPress version: 6.3.1
  • First release: Feb 2, 2015
  • Latest release: Sep 10, 2020
  • Number of updates: 118
  • Update frequency: every 17.4 days
  • Top authors: chopchoporg (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /110,619 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.72MB] [CPU: ▼5.79ms] Passed 4 tests

An overview of server-side resources used by Pop-Up Chop Chop
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.3944.00 ▼4.78
Dashboard /wp-admin4.16 ▲0.8255.62 ▼9.16
Posts /wp-admin/edit.php4.19 ▲0.8356.86 ▲6.44
Add New Post /wp-admin/post-new.php6.76 ▲0.8789.10 ▼15.67
Media Library /wp-admin/upload.php4.09 ▲0.8543.90 ▲8.39
Pop-Ups Chop Chop /wp-admin/edit.php?post_type=chch-pop-up4.1349.25
Add New Pop-Up /wp-admin/post-new.php?post_type=chch-pop-up4.6363.43

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Pop-Up Chop Chop
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,836 ▲9013.73 ▼0.861.88 ▲0.2078.02 ▲38.41
Dashboard /wp-admin2,244 ▲565.91 ▲0.04102.66 ▼5.2538.18 ▼7.23
Posts /wp-admin/edit.php2,124 ▲352.06 ▲0.0537.70 ▲2.4037.82 ▲2.02
Add New Post /wp-admin/post-new.php1,546 ▲3223.45 ▲5.80672.13 ▼23.2255.41 ▼8.52
Media Library /wp-admin/upload.php1,426 ▲414.26 ▲0.04103.44 ▲3.7045.66 ▼0.39
Pop-Ups Chop Chop /wp-admin/edit.php?post_type=chch-pop-up1,1012.0036.9730.20
Add New Pop-Up /wp-admin/post-new.php?post_type=chch-pop-up2,9017.75177.13104.59

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 35× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/pop-up/admin/includes/CMB2/bootstrap.php:17
    • > PHP Warning
      Use of undefined constant CHCH_LIVE_PREVIEW_FREE_DIR - assumed 'CHCH_LIVE_PREVIEW_FREE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pop-up/admin/includes/chch-live-preview-free/includes/LP-include.php on line 3
    • > PHP Warning
      require_once(CHCH_LIVE_PREVIEW_FREE_DIRthird-party/PluginMetaData.php): failed to open stream: No such file or directory in wp-content/plugins/pop-up/admin/includes/chch-live-preview-free/includes/LP_Views.php on line 4
    • > PHP Warning
      Use of undefined constant CHCH_LIVE_PREVIEW_FREE_DIR - assumed 'CHCH_LIVE_PREVIEW_FREE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pop-up/admin/includes/chch-live-preview-free/includes/LP_Views.php on line 4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/pop-up/admin/includes/CMB2/tests/cmb-tests-base.php:10
    • > PHP Warning
      Use of undefined constant CHCH_LIVE_PREVIEW_FREE_DIR - assumed 'CHCH_LIVE_PREVIEW_FREE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pop-up/admin/includes/chch-live-preview-free/includes/LP-include.php on line 22
    • > PHP Warning
      Use of undefined constant CHCH_LIVE_PREVIEW_FREE_DIR - assumed 'CHCH_LIVE_PREVIEW_FREE_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/pop-up/admin/includes/chch-live-preview-free/includes/LP-include.php on line 17
    • > PHP Notice
      Undefined variable: test_root in wp-content/plugins/pop-up/admin/includes/CMB2/tests/bootstrap.php on line 24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pop-up/admin/includes/chch-live-preview-free/chch-live-preview-free-init.php:31
    • > PHP Warning
      require_once(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/pop-up/admin/includes/CMB2/tests/bootstrap.php on line 24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

pop-up/pop-up.php 92% from 13 tests

The main PHP script in "Pop-Up Chop Chop" version 2.1.7 is automatically included on every request by WordPress
The following require your attention:
  • 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 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin103,941 lines of code in 190 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File948,87311,78920,306
CSS182,3361,19513,491
JSON40012,485
PHP522,1993,6657,262
JavaScript123171851,490
SVG100520
Markdown41560427
YAML290152
Bourne Shell118767

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity26.00
▷ Minimum class complexity1.00
▷ Maximum class complexity107.00
Average method complexity2.90
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes34
▷ Abstract classes12.94%
▷ Concrete classes3397.06%
▷ Final classes00.00%
Methods447
▷ Static methods408.95%
▷ Public methods40891.28%
▷ Protected methods92.01%
▷ Private methods306.71%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants13
▷ Global constants861.54%
▷ Class constants538.46%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
20 compressed PNG files occupy 0.16MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/includes/CMB2/images/ico-delete.png0.70KB0.72KB0.00%
admin/includes/CMB2/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
admin/includes/CMB2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
admin/includes/CMB2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
admin/includes/CMB2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%