83% contact-form-7-newsletter

Code Review | Contact Form 7 Newsletter

WordPress plugin Contact Form 7 Newsletter scored83%from 54 tests.

About plugin

  • Plugin page: contact-form-7-ne...
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.4
  • WordPress version: 6.3.1
  • First release: Jun 15, 2012
  • Latest release: Dec 30, 2015
  • Number of updates: 66
  • Update frequency: every 19.6 days
  • Top authors: katzwebdesign (93.94%)luistinygod (7.58%)

Code review

54 tests

User reviews

24 reviews

Install metrics

1,000+ active /70,152 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
Installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼7.10ms] Passed 4 tests

Analyzing server-side resources used by Contact Form 7 Newsletter
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1137.08 ▼0.43
Dashboard /wp-admin3.41 ▲0.0742.97 ▼20.96
Posts /wp-admin/edit.php3.53 ▲0.1745.55 ▲1.72
Add New Post /wp-admin/post-new.php5.99 ▲0.1187.25 ▼8.73
Media Library /wp-admin/upload.php3.33 ▲0.1136.22 ▲2.39

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 74 new files
Database: no new tables, 8 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
ctct_cf7_version
widget_recent-posts
widget_recent-comments
db_upgraded
ctct_cf7_updated

Browser metrics Passed 4 tests

A check of browser resources used by Contact Form 7 Newsletter
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6913.35 ▼0.913.91 ▲2.2839.35 ▼0.26
Dashboard /wp-admin2,221 ▲355.11 ▲0.1499.26 ▼8.2441.11 ▼2.20
Posts /wp-admin/edit.php2,103 ▲172.17 ▲0.1340.91 ▲6.7036.26 ▼0.65
Add New Post /wp-admin/post-new.php1,552 ▲2218.37 ▼4.90647.42 ▼23.1267.84 ▲10.94
Media Library /wp-admin/upload.php1,403 ▲154.21 ▼0.02109.58 ▲3.9647.63 ▲0.17

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
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • ctct_cf7_version
    • ctct_cf7_updated
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% 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
Please fix the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'CTCTUtility' not found in wp-content/plugins/contact-form-7-newsletter/api/ctct_cf7_superclass.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CTCTCF7' not found in wp-content/plugins/contact-form-7-newsletter/shortcode.php:3
    • > PHP Fatal error
      Uncaught Error: Cannot access self:: when no class scope is active in wp-content/plugins/contact-form-7-newsletter/tag-generator.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'CTCT_SuperClass' not found in wp-content/plugins/contact-form-7-newsletter/metabox.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/contact-form-7-newsletter/cf7-constantcontact.php:31
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/contact-form-7-newsletter/shortcode-js.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Configure your Constant Contact settings), #2 (Insert a tag that specifies how you would like users to sign up), #3 (Map the Contact Form 7 form fields to the Constant Contact fields), #4 (When a form is connected to Constant Contact, you will see this icon)
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

contact-form-7-newsletter/cf7-constantcontact.php 92% from 13 tests

"Contact Form 7 Newsletter" version 2.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-form-7-newsletter.php" instead of "cf7-constantcontact.php")

Code Analysis Passed 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
Success! There were no dangerous files found in this plugin4,880 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP97969023,951
JavaScript2183112635
CSS2474293
HTML1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity14.95
▷ Minimum class complexity1.00
▷ Maximum class complexity130.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods561
▷ Static methods213.74%
▷ Public methods54496.97%
▷ Protected methods10.18%
▷ Private methods162.85%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
45 PNG files occupy 1.05MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
help/images/prettyPhoto/dark_rounded/contentPattern.png0.13KB0.09KB▼ 25.38%
help/images/How_to_Configure_the_Contact_Form_7_Newsletter_Plugin/media_1379972945525.png22.31KB7.82KB▼ 64.94%
CTCT_horizontal_logo.png5.89KB3.50KB▼ 40.48%
help/images/prettyPhoto/light_square/btnPrevious.png1.41KB1.19KB▼ 15.74%
help/images/prettyPhoto/facebook/contentPatternRight.png0.13KB0.10KB▼ 24.26%