77% cf7-creamailer-extension

Code Review | Contact Form 7 Creamailer Extension

WordPress plugin Contact Form 7 Creamailer Extension scored 77% from 54 tests.

About plugin

  • Plugin page: cf7-creamailer-ex...
  • Plugin version: 0.1.4.3
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Feb 1, 2019
  • Latest release: Aug 25, 2022
  • Number of updates: 21
  • Update frequency: every 62.0 days
  • Top authors: souroatmilk (95.24%)gurumedia (9.52%)

Code review

54 tests

User reviews

2 reviews

Install metrics

80+ active / 4,777 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.40MB] [CPU: ▼1.90ms] Passed 4 tests

An overview of server-side resources used by Contact Form 7 Creamailer Extension
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4437.63 ▼10.83
Dashboard /wp-admin3.74 ▲0.4347.09 ▲0.01
Posts /wp-admin/edit.php3.79 ▲0.4353.10 ▲4.85
Add New Post /wp-admin/post-new.php6.26 ▲0.3796.87 ▲0.87
Media Library /wp-admin/upload.php3.60 ▲0.3739.46 ▲2.36

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 452 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Form 7 Creamailer Extension
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.22 ▼1.561.57 ▼0.3836.82 ▼15.46
Dashboard /wp-admin2,210 ▲224.86 ▼0.0295.46 ▼12.3537.39 ▼4.15
Posts /wp-admin/edit.php2,096 ▲72.04 ▲0.0540.62 ▲4.4333.61 ▲1.36
Add New Post /wp-admin/post-new.php1,356 ▼16116.62 ▼0.90571.23 ▼61.5549.49 ▲2.56
Media Library /wp-admin/upload.php1,389 ▼24.24 ▼0.0598.40 ▲3.2440.42 ▼1.78

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cf7-creamailer-extension/vendor/phpoption/phpoption/tests/bootstrap.php
  • 191× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/cf7-creamailer-extension/vendor/guzzlehttp/psr7/src/BufferStream.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/cf7-creamailer-extension/vendor/paragonie/random_compat/tests/unit_with_basedir/UtilityTest.php:2
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/cf7-creamailer-extension/vendor/guzzlehttp/promises/src/FulfilledPromise.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/cf7-creamailer-extension/vendor/psr/http-message/src/RequestInterface.php:24
    • > PHP Warning
      require_once(wp-content/plugins/cf7-creamailer-extension/vendor/paragonie/random_compat/lib/byte_safe_strings.php): failed to open stream: No such file or directory in wp-content/plugins/cf7-creamailer-extension/vendor/paragonie/random_compat/tests/specific/capicom.php on line 3
    • > PHP Warning
      fwrite() expects parameter 1 to be resource, string given in wp-content/plugins/cf7-creamailer-extension/vendor/guzzlehttp/guzzle/build/Burgomaster.php on line 115
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/cf7-creamailer-extension/vendor/vlucas/phpdotenv/tests/Dotenv/FactoryTest.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'GuzzleHttp\\Promise\\PromiseInterface' not found in wp-content/plugins/cf7-creamailer-extension/vendor/guzzlehttp/promises/src/Promise.php:9
    • > PHP Fatal error
      Uncaught Error: Interface 'Dotenv\\Environment\\Adapter\\AdapterInterface' not found in wp-content/plugins/cf7-creamailer-extension/vendor/vlucas/phpdotenv/src/Environment/Adapter/ArrayAdapter.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\MessageInterface' not found in wp-content/plugins/cf7-creamailer-extension/vendor/psr/http-message/src/ResponseInterface.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #0 (screenshot-1.png)
  • Screenshots: Please describe screenshot #1 in cf7-creamailer-extension/assets to your readme.txt
You can look at the official readme.txt

cf7-creamailer-extension/cf7cm-standalone.php 85% from 13 tests

This is the main PHP file of "Contact Form 7 Creamailer Extension" version 0.1.4.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cf7-creamailer-extension.php" instead of "cf7cm-standalone.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin62,399 lines of code in 387 files:
LanguageFilesBlank linesComment linesLines of code
PHP2784,6468,88143,476
JSON210010,851
Markdown371,47304,453
reStructuredText88591,0811,132
CSS12130852
YAML17922539
JavaScript435153304
XML1000282
make5595232
Sass1210105
PO File1343485
Bourne Shell28750
Python1182228
Dockerfile18010

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
The following items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity8.70
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces39
Interfaces24
Traits3
Classes222
▷ Abstract classes41.80%
▷ Concrete classes21898.20%
▷ Final classes2310.55%
Methods2,167
▷ Static methods1798.26%
▷ Public methods1,96890.82%
▷ Protected methods291.34%
▷ Private methods1707.84%
Functions578
▷ Named functions9015.57%
▷ Anonymous functions48884.43%
Constants178
▷ Global constants5128.65%
▷ Class constants12771.35%
▷ Public constants127100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.72MB with 0.48MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png64.18KB22.81KB▼ 64.45%
assets/screenshot-1.0.1.2.png114.58KB37.77KB▼ 67.03%
vendor/guzzlehttp/guzzle/docs/_static/logo.png241.87KB69.68KB▼ 71.19%
assets/screenshot-1.0.1.0.png104.55KB38.97KB▼ 62.72%
assets/images/logo.png31.44KB10.78KB▼ 65.70%