68% cm-pop-up-banners

Code Review | CM Popup Plugin for WordPress

WordPress plugin CM Popup Plugin for WordPress scored68%from 54 tests.

About plugin

  • Plugin page: cm-pop-up-banners
  • Plugin version: 1.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Jun 2, 2015
  • Latest release: Jul 23, 2023
  • Number of updates: 287
  • Update frequency: every 10.4 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

10,000+ active /363,810 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲1.56MB] [CPU: ▲4.56ms] 75% from 4 tests

This is a short check of server-side resources used by CM Popup Plugin for WordPress
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,098.30ms on /wp-admin/admin.php?page=cm-popupflyin-settings)
PageMemory (MB)CPU Time (ms)
Home /4.83 ▲1.3750.38 ▲11.99
Dashboard /wp-admin4.92 ▲1.6256.01 ▲6.09
Posts /wp-admin/edit.php5.03 ▲1.6849.35 ▲6.11
Add New Post /wp-admin/post-new.php7.52 ▲1.6391.61 ▼4.69
Media Library /wp-admin/upload.php4.84 ▲1.6143.65 ▲10.73
Import/Export /wp-admin/admin.php?page=cm-popupflyin-import_export4.8741.41
Statistics /wp-admin/admin.php?page=cm-popupflyin-statistics4.8742.59
Settings /wp-admin/admin.php?page=cm-popupflyin-settings5.071,098.30
Add New Campaign /wp-admin/post-new.php?post_type=cm-ad-item5.1966.45
Upgrade ➤ /wp-admin/admin.php?page=cmpopfly_pro4.8741.24
User Guide /wp-admin/admin.php?page=cmpopfly_about4.95466.13
Campaigns /wp-admin/edit.php?post_type=cm-ad-item4.8947.27

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 217 new files
Database: 1 new table, 8 new options
New tables
wp_cm_popfly_history
New WordPress options
cmpopfly_options
db_upgraded
cmpopfly_custom_post_type_support
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by CM Popup Plugin for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,854 ▲10814.82 ▲0.441.82 ▼0.0845.40 ▲3.76
Dashboard /wp-admin2,260 ▲754.83 ▼0.07115.53 ▲12.2748.85 ▲5.46
Posts /wp-admin/edit.php2,143 ▲572.02 ▼0.0233.65 ▼3.6337.70 ▲5.12
Add New Post /wp-admin/post-new.php6,289 ▲4,74726.22 ▲7.49927.11 ▲293.4962.56 ▼0.98
Media Library /wp-admin/upload.php1,442 ▲574.18 ▼0.0595.40 ▼6.5443.17 ▼4.59
Import/Export /wp-admin/admin.php?page=cm-popupflyin-import_export1,0541.8829.6168.11
Statistics /wp-admin/admin.php?page=cm-popupflyin-statistics1,0501.9127.7037.09
Settings /wp-admin/admin.php?page=cm-popupflyin-settings2,8938.4584.2559.16
Add New Campaign /wp-admin/post-new.php?post_type=cm-ad-item4,14610.00241.6188.49
Upgrade ➤ /wp-admin/admin.php?page=cmpopfly_pro1,8881.9834.5580.86
User Guide /wp-admin/admin.php?page=cmpopfly_about3,99916.58369.12160.23
Campaigns /wp-admin/edit.php?post_type=cm-ad-item1,1481.9831.7536.67

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_cm_popfly_history
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • can_compress_scripts
    • cmpopfly_options
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • cmpopfly_custom_post_type_support
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
The following issues need your attention
  • 12× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cm-pop-up-banners/libs/wpalchemy/class/metabox.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-pop-up-banners/package/views/plugin_compare_table.php:51
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cm-pop-up-banners/libs/wpalchemy/metaboxes/cm-help-items.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/cm-pop-up-banners/package/views/registration.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-pop-up-banners/package/cminds-plugin-config.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_print_styles() in wp-content/plugins/cm-pop-up-banners/libs/wpalchemy/metaboxes/cm-help-items-options.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'com\\cminds\\popupfly\\Settings' not found in wp-content/plugins/cm-pop-up-banners/shared/classes/settings/CMPOPFLY_Settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-pop-up-banners/package/cminds-plugin-config.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-pop-up-banners/package/views/userguide_free.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cm-pop-up-banners/libs/wpalchemy/class/metabox.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=cm-popupflyin-import_export
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tabs is not a function" "TypeError: $(...).tabs is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=cm-popupflyin-import_export:624:24)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cm-popupflyin-statistics
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).tabs is not a function
    • > GET request to /wp-admin/admin.php?page=cm-popupflyin-statistics
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).tabs is not a function" "TypeError: $(...).tabs is not a function\n at HTMLDocument.\u003Canonymous> (/wp-admin/admin.php?page=cm-popupflyin-statistics:624:24)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=cmpopfly_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmpopfly_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmpopfly_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yx/r/RBH7b7zeA6F.js?_nc_x=Ij3Wp8lg5Kz 271 Listener added for a synchronous 'DOMSubtreeModified' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.
    • > GET request to /wp-admin/admin.php?page=cmpopfly_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yx/r/RBH7b7zeA6F.js?_nc_x=Ij3Wp8lg5Kz 60:573 "ErrorUtils caught an error:\n\nCannot listen to an undefined element. [Caught in: Tried to listen to element of type click]\n\nSubsequent non-fatal errors won't be logged; see https://fburl.com/debugjs."

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
10 plugin tags: advertize, events, flyin, pop up, image...

cm-pop-up-banners/cm-pop-up-banners-for-wordpress.php 92% from 13 tests

The main PHP file in "CM Popup Plugin for WordPress" ver. 1.6.0 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("cm-pop-up-banners.php" instead of "cm-pop-up-banners-for-wordpress.php")

Code Analysis Passed 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 detected20,352 lines of code in 86 files:
LanguageFilesBlank linesComment linesLines of code
PHP401,8242,25410,677
JavaScript241,1729885,406
CSS212572024,264
Markdown1305

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity78.81
▷ Minimum class complexity1.00
▷ Maximum class complexity328.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes16
▷ Abstract classes16.25%
▷ Concrete classes1593.75%
▷ Final classes16.67%
Methods323
▷ Static methods17253.25%
▷ Public methods27986.38%
▷ Protected methods278.36%
▷ Private methods175.26%
Functions15
▷ Named functions1173.33%
▷ Anonymous functions426.67%
Constants65
▷ Global constants3553.85%
▷ Class constants3046.15%
▷ Public constants30100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
120 PNG files occupy 0.73MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
shared/assets/css/jquery-ui/smoothness/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
backend/assets/images/tabsBg.png0.76KB0.59KB▼ 22.54%
shared/assets/css/jquery-ui/smoothness/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
package/css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
shared/assets/css/jquery-ui/smoothness/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%