10% cpm-all-in-one-responsive-poll

Code Review | CPM All in one Poll

WordPress plugin CPM All in one Poll scored10%from 54 tests.

About plugin

  • Plugin page: cpm-all-in-one-re...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.3
  • WordPress version: 6.3.1
  • First release: Aug 7, 2015
  • Latest release: Aug 25, 2015
  • Number of updates: 10
  • Update frequency: every 1.9 days
  • Top authors: utsavsinghrathour (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active /1,722 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/cpm-all-in-one-responsive-poll/includes/backend.php+44
    Methods with the same name as their class will not be constructors in a future version of PHP; CPM_wp_poll_Widget has a deprecated constructor

Server metrics [RAM: ▼1.77MB] [CPU: ▼54.11ms] Passed 4 tests

A check of server-side resources used by CPM All in one Poll
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.22 ▼1.2510.30 ▼29.99
Dashboard /wp-admin2.24 ▼1.076.95 ▼47.61
Posts /wp-admin/edit.php2.24 ▼1.128.12 ▼43.59
Add New Post /wp-admin/post-new.php2.24 ▼3.657.81 ▼93.77
Media Library /wp-admin/upload.php2.24 ▼0.996.37 ▼31.46
Add New /wp-admin/post-new.php?post_type=cpm_wp_poll2.248.69
All Poll /wp-admin/edit.php?post_type=cpm_wp_poll2.246.96

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 57 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_cpm_wp_poll_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CPM All in one Poll
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,986 ▲20013.73 ▼0.8012.43 ▲10.5041.08 ▼4.73
Dashboard /wp-admin2,256 ▲825.79 ▲0.2290.33 ▲0.1143.60 ▼2.36
Posts /wp-admin/edit.php2,174 ▲742.08 ▲0.0840.34 ▼0.7035.53 ▼7.78
Add New Post /wp-admin/post-new.php1,580 ▲6323.72 ▲4.76633.43 ▲142.4156.24 ▼5.16
Media Library /wp-admin/upload.php1,468 ▲684.24 ▲0.0494.08 ▼18.7943.19 ▼4.32
Add New /wp-admin/post-new.php?post_type=cpm_wp_poll1,7192.8366.5650.36
All Poll /wp-admin/edit.php?post_type=cpm_wp_poll1,1572.1431.5930.30

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/cpm-all-in-one-responsive-poll/includes/backend.php+44
    Methods with the same name as their class will not be constructors in a future version of PHP; CPM_wp_poll_Widget has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_cpm_wp_poll_widget
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=cpm_wp_poll
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/cpm-all-in-one-responsive-poll/includes/backend.php+44
    Methods with the same name as their class will not be constructors in a future version of PHP; CPM_wp_poll_Widget has a deprecated constructor
    • > GET request to /wp-admin/post-new.php?post_type=cpm_wp_poll
    • > Notice in wp-content/plugins/cpm-all-in-one-responsive-poll/includes/backend.php+157
    Trying to access array offset on value of type bool

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 items
  • 7× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpm-all-in-one-responsive-poll/includes/backend.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/cpm-all-in-one-responsive-poll/templates/single-cpm_wp_poll.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cpm-all-in-one-responsive-poll/index.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpm-all-in-one-responsive-poll/media.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpm-all-in-one-responsive-poll/admin.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/cpm-all-in-one-responsive-poll/constants.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cpm-all-in-one-responsive-poll/includes/frontend.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/post-new.php?post_type=cpm_wp_poll
    • > Javascript (severe) in unknown
    /wp-admin/post-new.php?post_type=cpm_wp_poll 425:36 Uncaught TypeError: jQuery(...).live is not a function
    • > GET request to /wp-admin/post-new.php?post_type=cpm_wp_poll
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/cpm-all-in-one-responsive-poll/media/js/cpm-poll-init.js?ver=6.3.1:40:42)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&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,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=cpm_wp_poll
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function
    • > GET request to /wp-admin/edit.php?post_type=cpm_wp_poll
    • > 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: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/cpm-all-in-one-responsive-poll/media/js/cpm-poll-init.js?ver=6.3.1:40:42)\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/edit.php?post_type=cpm_wp_poll
    • > 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: jQuery(...).live is not a function

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 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
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt might help

cpm-all-in-one-responsive-poll/index.php 77% from 13 tests

The main PHP file in "CPM All in one Poll" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 236 characters long)
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: The principal plugin file should be the same as the plugin slug ("cpm-all-in-one-responsive-poll.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,590 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP993124958
CSS82641894
JavaScript8750738

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions40
▷ Named functions40100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
26 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
media/images/custom_rgb_r.png0.99KB0.74KB▼ 25.34%
media/images/custom_hsb_s.png1.14KB0.89KB▼ 21.75%
media/images/select2.png0.51KB0.33KB▼ 34.94%
media/images/custom_hsb_h.png0.95KB0.73KB▼ 23.40%
media/images/custom_rgb_b.png0.98KB0.74KB▼ 25.00%