78% wp-pgp-encrypted-emails

Code Review | WP PGP Encrypted Emails

WordPress plugin WP PGP Encrypted Emails scored78%from 54 tests.

About plugin

  • Plugin page: wp-pgp-encrypted-...
  • Plugin version: 0.8.0
  • PHP version: 7.4.16
  • WordPress compatibility: ([0-9.]+)$/', $line, $m );-5.7
  • WordPress version: 6.3.1
  • First release: Jan 22, 2016
  • Latest release: May 25, 2021
  • Number of updates: 66
  • Update frequency: every 29.6 days
  • Top authors: meitar (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

600+ active /19,924 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.64MB] [CPU: ▲3.09ms] Passed 4 tests

This is a short check of server-side resources used by WP PGP Encrypted Emails
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3541.33 ▼12.89
Dashboard /wp-admin4.10 ▲0.8058.97 ▲5.83
Posts /wp-admin/edit.php4.10 ▲0.7560.13 ▲8.99
Add New Post /wp-admin/post-new.php6.56 ▲0.68116.13 ▲14.16
Media Library /wp-admin/upload.php4.10 ▲0.8746.24 ▲10.42
Email Encryption /wp-admin/options-general.php?page=wp-pgp-encrypted-emails4.1034.29

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

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

Browser metrics Passed 4 tests

A check of browser resources used by WP PGP Encrypted Emails
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7013.26 ▼1.335.13 ▲3.0046.99 ▼15.43
Dashboard /wp-admin2,209 ▲214.83 ▼1.06105.03 ▼4.9840.94 ▼6.10
Posts /wp-admin/edit.php2,095 ▲32.04 ▲0.0448.63 ▲7.2044.18 ▲5.15
Add New Post /wp-admin/post-new.php1,533 ▲1423.20 ▼0.21692.80 ▼15.7062.15 ▲6.97
Media Library /wp-admin/upload.php1,394 ▲64.18 ▼0.04110.80 ▲2.0546.54 ▼2.62
Email Encryption /wp-admin/options-general.php?page=wp-pgp-encrypted-emails8812.0624.4932.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=wp-pgp-encrypted-emails
    • > Notice in wp-content/plugins/wp-pgp-encrypted-emails/wp-pgp-encrypted-emails.php+1053
    Trying to access array offset on value of type bool

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
  • 28× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_rsa.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\et\\SSH2' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php:47
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_rsa.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/phpseclib/phpseclib/phpseclib/Crypt/Rijndael.php:64
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/singpolyma/openpgp-php/tests/suite.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_rsa.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_rsa.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_rsa.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/wp-pgp-encrypted-emails/vendor/phpseclib/phpseclib/phpseclib/Crypt/DES.php:52
    • > PHP Fatal error
      Uncaught Error: Class 'Plugin_UnitTestCase' not found in wp-content/plugins/wp-pgp-encrypted-emails/tests/test-wp-openpgp.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
8 plugin tags: privacy, encryption, smime, email, security...

wp-pgp-encrypted-emails/wp-pgp-encrypted-emails.php 85% from 13 tests

The primary PHP file in "WP PGP Encrypted Emails" version 0.8.0 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Requires at least: Required version number should use periods and dots only (ex. "7.0" instead of "([0-9.]+)$/', $line, $m );")
  • Description: The description should be shorter than 140 characters (currently 494 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected26,352 lines of code in 89 files:
LanguageFilesBlank linesComment linesLines of code
PHP674,44913,07725,359
JSON500423
Markdown61230241
YAML541148
Bourne Shell120694
XML36054
dhall10030
CSS1033

PHP code 50% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity44.37
▷ Minimum class complexity1.00
▷ Maximum class complexity633.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes94
▷ Abstract classes11.06%
▷ Concrete classes9398.94%
▷ Final classes22.15%
Methods1,053
▷ Static methods12611.97%
▷ Public methods1,04098.77%
▷ Protected methods20.19%
▷ Private methods111.04%
Functions18
▷ Named functions422.22%
▷ Anonymous functions1477.78%
Constants193
▷ Global constants2311.92%
▷ Class constants17088.08%
▷ Public constants170100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There were not PNG files found in your plugin