62% cc-easy-popup

Code Review | CC Easy Popup

WordPress plugin CC Easy Popup scored62%from 54 tests.

About plugin

  • Plugin page: cc-easy-popup
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 11, 2016
  • Latest release: Nov 18, 2016
  • Number of updates: 4
  • Update frequency: every 2.0 days
  • Top authors: sjrb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /803 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.94MB] [CPU: ▼39.30ms] Passed 4 tests

A check of server-side resources used by CC Easy Popup
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0040.29 ▼1.61
Dashboard /wp-admin3.00 ▼0.3022.97 ▼32.56
Posts /wp-admin/edit.php3.00 ▼0.3524.21 ▼27.84
Add New Post /wp-admin/post-new.php3.00 ▼2.8825.25 ▼79.50
Media Library /wp-admin/upload.php3.00 ▼0.2320.04 ▼17.30
Subscribers /wp-admin/admin.php?page=CC_newsletter_admin_subscribers3.0022.13
Settings /wp-admin/admin.php?page=CC_popup_admin_settings3.0024.52

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for CC Easy Popup
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,086 ▲34015.05 ▲0.307.15 ▲4.1855.55 ▲11.70
Dashboard /wp-admin2,371 ▲1836.46 ▲0.55131.32 ▲20.0943.70 ▲0.43
Posts /wp-admin/edit.php2,277 ▲1853.35 ▲1.3649.31 ▲11.1635.45 ▼0.21
Add New Post /wp-admin/post-new.php1,538 ▲523.45 ▲0.48657.13 ▼1.1736.90 ▼27.87
Media Library /wp-admin/upload.php1,407 ▲194.14 ▼0.0982.72 ▼16.5243.43 ▼2.52
Subscribers /wp-admin/admin.php?page=CC_newsletter_admin_subscribers9613.0840.5222.09
Settings /wp-admin/admin.php?page=CC_popup_admin_settings1,6457.00138.3454.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall without warnings or errors
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CC_popup_admin_settings
    • > User deprecated in wp-includes/functions.php+5453
    Function add_object_page is deprecated since version 4.5.0! Use add_menu_page() instead.
    • > GET request to /wp-admin/admin.php?page=CC_popup_admin_settings
    • > Warning in wp-content/plugins/cc-easy-popup/admin/CC-popup-admin-callbacks.php+158
    Use of undefined constant CC_POPUP_AJAX_URL - assumed 'CC_POPUP_AJAX_URL' (this will throw an Error in a future version of PHP)

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
Please take a closer look at the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cc-easy-popup/CC-easy-popup.php:13
    • > PHP Warning
      require_once(CPAS_POPUP_PATHadmin/CC-popup-admin-callbacks.php): failed to open stream: No such file or directory in wp-content/plugins/cc-easy-popup/admin/CC-popup-admin-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cc-easy-popup/scripts.php:15
    • > PHP Fatal error
      require_once(): Failed opening required 'CPAS_POPUP_PATHadmin/CC-popup-admin-callbacks.php' (include_path='.:/usr/share/php') in wp-content/plugins/cc-easy-popup/admin/CC-popup-admin-settings.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cc-easy-popup/CC-popup-frontend.php:13
    • > PHP Warning
      Use of undefined constant CPAS_POPUP_PATH - assumed 'CPAS_POPUP_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cc-easy-popup/admin/CC-popup-admin-settings.php on line 2

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=CC_popup_admin_settings
    • > Rendering (warning) in unknown
    /wp-admin/admin.php?page=CC_popup_admin_settings 163 The specified value "" does not conform to the required format. The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #1 (Demo Popup in the pages.), #2 (Setting options in Administration panel.)
  • Tags: Please delete some tags, you are using 22 tag instead of maximum 10
The official readme.txt might help

cc-easy-popup/CC-easy-popup.php 92% from 13 tests

The principal PHP file in "CC Easy Popup" v. 1.0.0 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cc-easy-popup.php" instead of "CC-easy-popup.php")

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
No dangerous file extensions were detected863 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP54690455
JavaScript23551225
CSS1814183

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity37.00
▷ Minimum class complexity27.00
▷ Maximum class complexity47.00
Average method complexity5.50
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.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
5 PNG files occupy 0.66MB with 0.43MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/sample-7.png136.63KB69.46KB▼ 49.16%
assets/img/sample-4.png54.26KB20.01KB▼ 63.11%
Classic.png127.92KB35.01KB▼ 72.63%
modern.png140.09KB37.74KB▼ 73.06%
Trendy.png215.85KB63.34KB▼ 70.66%