10% email-cop

Code Review | Email Cop

WordPress plugin Email Cop scored10%from 54 tests.

About plugin

  • Plugin page: email-cop
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.4
  • WordPress version: 6.3.1
  • First release: Jan 21, 2015
  • Latest release: Nov 5, 2019
  • Number of updates: 10
  • Update frequency: every 174.9 days
  • Top authors: ashfame (80%)deployer (30%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,366 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
The following installer errors require your attention
  • The plugin cannot be installed
    • > User deprecated in wp-includes/functions.php+5643
    File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.

Server metrics [RAM: ▼1.96MB] [CPU: ▼55.56ms] Passed 4 tests

A check of server-side resources used by Email Cop
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.99 ▼39.70
Dashboard /wp-admin2.05 ▼1.256.28 ▼46.34
Posts /wp-admin/edit.php2.05 ▼1.305.55 ▼41.77
Add New Post /wp-admin/post-new.php2.05 ▼3.845.71 ▼94.43
Media Library /wp-admin/upload.php2.05 ▼1.184.71 ▼31.30
Add New /wp-admin/post-new.php?post_type=wp_cop_email2.055.69
Emails /wp-admin/edit.php?post_type=wp_cop_email2.056.01

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Email Cop
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,867 ▲13213.20 ▼1.181.81 ▼0.0640.51 ▼2.27
Dashboard /wp-admin2,245 ▲574.89 ▲0.03115.82 ▼0.8540.00 ▼8.88
Posts /wp-admin/edit.php2,130 ▲412.01 ▼0.0139.87 ▲1.7533.76 ▼1.31
Add New Post /wp-admin/post-new.php1,568 ▲3523.28 ▼0.07673.40 ▲17.6960.72 ▲6.42
Media Library /wp-admin/upload.php1,424 ▲364.22 ▲0.01101.06 ▼4.5143.42 ▲2.49
Add New /wp-admin/post-new.php?post_type=wp_cop_email2,1757.56177.8464.28
Emails /wp-admin/edit.php?post_type=wp_cop_email1,0911.9531.3831.34

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5643
    File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=wp_cop_email
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5643
    File class-phpmailer.php is deprecated since version 5.5.0! Use wp-includes/PHPMailer/PHPMailer.php instead. The PHPMailer class has been moved to wp-includes/PHPMailer subdirectory and now uses the PHPMailer\PHPMailer namespace.

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
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(ABSPATHwp-includes/class-phpmailer.php): failed to open stream: No such file or directory in wp-content/plugins/email-cop/inc/wpcop-mailer.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function the_post() in wp-content/plugins/email-cop/inc/cpt_template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/email-cop/plugin.php:20
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/class-phpmailer.php' (include_path='.:/usr/share/php') in wp-content/plugins/email-cop/inc/wpcop-mailer.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/email-cop/inc/wpcop-mailer.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
3 plugin tags: tools, email, development

email-cop/plugin.php 92% from 13 tests

The main PHP file in "Email Cop" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("email-cop.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin263 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP33620263

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity8.50
▷ Minimum class complexity4.00
▷ Maximum class complexity13.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin