68% cm-email-blacklist

Code Review | CM Email Registration Blacklist

WordPress plugin CM Email Registration Blacklist scored68%from 54 tests.

About plugin

  • Plugin page: cm-email-blacklist
  • Plugin version: 1.4.5
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4.0-6.3
  • WordPress version: 6.3.1
  • First release: Feb 4, 2013
  • Latest release: Jul 23, 2023
  • Number of updates: 233
  • Update frequency: every 16.4 days
  • Top authors: CreativeMindsSolutions (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /26,631 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
Install script ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▼3.55ms] 75% from 4 tests

Analyzing server-side resources used by CM Email Registration Blacklist
Please have a look at the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 1,061.68ms on /wp-admin/admin.php?page=cmeb_menu)
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲0.6647.10 ▲1.64
Dashboard /wp-admin3.97 ▲0.6257.99 ▼6.80
Posts /wp-admin/edit.php4.02 ▲0.6655.18 ▼0.62
Add New Post /wp-admin/post-new.php6.49 ▲0.6099.58 ▼7.83
Media Library /wp-admin/upload.php3.83 ▲0.6039.76 ▲1.07
CM E-Mail Registration Blacklist /wp-admin/admin.php?page=cmeb_menu5.681,061.68
User Guide /wp-admin/admin.php?page=cmeb_about4.00413.99
Upgrade ➤ /wp-admin/admin.php?page=cmeb_pro3.8443.41

Server storage [IO: ▲0.95MB] [DB: ▲0.05MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 78 new files
Database: 3 new tables, 9 new options
New tables
wp_cmeb_email_list
wp_cmeb_free_domains
wp_cmeb_userlist
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
last_free_domain_list_update
can_compress_scripts
widget_theysaidso_widget
cmeb_free_domains_ver
cmeb_user_list_ver
widget_recent-posts

Browser metrics Passed 4 tests

CM Email Registration Blacklist: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲5914.26 ▼0.091.81 ▼0.3444.13 ▲1.50
Dashboard /wp-admin2,229 ▲525.64 ▼0.0493.85 ▼1.1941.56 ▼1.84
Posts /wp-admin/edit.php2,131 ▲311.99 ▼0.0434.07 ▼5.7240.49 ▲2.24
Add New Post /wp-admin/post-new.php1,551 ▲2423.10 ▼0.24637.19 ▲27.2966.57 ▲14.26
Media Library /wp-admin/upload.php1,428 ▲314.14 ▼0.04101.84 ▲2.0248.50 ▲5.08
CM E-Mail Registration Blacklist /wp-admin/admin.php?page=cmeb_menu9,3226.3998.03224.87
User Guide /wp-admin/admin.php?page=cmeb_about3,99415.68372.95184.91
Upgrade ➤ /wp-admin/admin.php?page=cmeb_pro1,7512.1939.7869.17

Uninstaller [IO: ▲0.00MB] [DB: ▲0.05MB] 50% 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 tables were found after uninstall: 3 tables
    • wp_cmeb_email_list
    • wp_cmeb_userlist
    • wp_cmeb_free_domains
  • Zombie WordPress options were found after uninstall: 9 options
    • widget_recent-comments
    • theysaidso_admin_options
    • cmeb_user_list_ver
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • last_free_domain_list_update
    • widget_theysaidso_widget
    • cmeb_free_domains_ver

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'CMEB_PATH/backend/classes/SettingsViewAbstract.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cm-email-blacklist/backend/classes/SettingsView.php on line 2
    • > PHP Warning
      include_once(): Failed opening 'CMEB_PATH/lib/models/Validate.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cm-email-blacklist/lib/CMEB.php on line 3
    • > PHP Warning
      include_once(CMEB_PATH/lib/models/Validate.php): failed to open stream: No such file or directory in wp-content/plugins/cm-email-blacklist/lib/CMEB.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/cm-email-blacklist/cm-email-blacklist.php:91
    • > PHP Warning
      include_once(CMEB_PATH/backend/classes/Settings.php): failed to open stream: No such file or directory in wp-content/plugins/cm-email-blacklist/lib/CMEB.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-email-blacklist/package/cminds-plugin-config.php:3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/cm-email-blacklist/package/views/userguide_free.php:8
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-email-blacklist/cm-email-blacklist.php on line 88
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cm-email-blacklist/package/cminds-plugin-config.php:3
    • > PHP Warning
      Use of undefined constant CMEB_PATH - assumed 'CMEB_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/cm-email-blacklist/lib/CMEB.php on line 3

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/admin.php?page=cmeb_menu
    • > Network (severe)
    wp-content/plugins/cm-email-blacklist/backend/assets/css/images/ui-bg_flat_75_ffffff_40x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=cmeb_menu
    • > Network (severe)
    wp-content/plugins/cm-email-blacklist/backend/assets/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=cmeb_menu
    • > Network (severe)
    wp-content/plugins/cm-email-blacklist/backend/assets/css/images/ui-bg_glass_65_ffffff_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=cmeb_menu
    • > Network (severe)
    wp-content/plugins/cm-email-blacklist/backend/assets/css/images/ui-bg_glass_75_e6e6e6_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/admin.php?page=cmeb_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/admin.php?page=cmeb_about
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/admin.php?page=cmeb_about
    • > Deprecation (warning) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yT/r/JeAVSvamNTp.js?_nc_x=Ij3Wp8lg5Kz 275 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=cmeb_about
    • > Console-api (severe) in unknown
    https://static.xx.fbcdn.net/rsrc.php/v3/yT/r/JeAVSvamNTp.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 Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: spam, email, whitelist, blacklist, spamassassin

cm-email-blacklist/cm-email-blacklist.php Passed 13 tests

The main PHP script in "CM Email Registration Blacklist" version 1.4.5 is automatically included on every request by WordPress
62 characters long description:
Block users from certain domains from registering in your site

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
Success! There were no dangerous files found in this plugin6,518 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP308354265,703
CSS410732786
JavaScript30129

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity44.00
▷ Minimum class complexity3.00
▷ Maximum class complexity254.00
Average method complexity3.20
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes9
▷ Abstract classes111.11%
▷ Concrete classes888.89%
▷ Final classes00.00%
Methods178
▷ Static methods7240.45%
▷ Public methods15084.27%
▷ Protected methods2815.73%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants61
▷ Global constants1118.03%
▷ Class constants5081.97%
▷ Public constants50100.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
37 PNG files occupy 0.53MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
package/css/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
package/css/images/ui-icons_888888_256x240.png6.83KB4.17KB▼ 38.92%
package/views/no.png0.38KB0.44KB0.00%
package/views/appointments_icon.png38.00KB9.44KB▼ 75.16%
package/views/img/v1.png0.24KB0.23KB▼ 2.49%