83% cf7-intelligence

Code Review | Contact Form 7 Google Analytics Intelligence

WordPress plugin Contact Form 7 Google Analytics Intelligence scored83%from 54 tests.

About plugin

  • Plugin page: cf7-intelligence
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.3
  • WordPress version: 6.3.1
  • First release: May 11, 2017
  • Latest release: Feb 26, 2020
  • Number of updates: 31
  • Update frequency: every 32.9 days
  • Top authors: tomdude (100%)

Code review

54 tests

User reviews

1 review

Install metrics

900+ active /15,898 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
Install script ran successfully

Server metrics [RAM: ▲0.23MB] [CPU: ▼0.60ms] Passed 4 tests

Analyzing server-side resources used by Contact Form 7 Google Analytics Intelligence
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1540.91 ▼0.43
Dashboard /wp-admin3.56 ▲0.2548.99 ▼1.80
Posts /wp-admin/edit.php3.67 ▲0.3151.75 ▼1.47
Add New Post /wp-admin/post-new.php6.14 ▲0.25100.99 ▲5.72
Media Library /wp-admin/upload.php3.48 ▲0.2540.73 ▲1.29
Intelligence /wp-admin/admin.php?page=intel_admin3.48489.78
Setup /wp-admin/admin.php?page=intel_config3.48464.24
Intelligence /wp-admin/admin.php?page=wpcf7_intel3.4534.73

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 7 new options
New WordPress options
intel_setup
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Contact Form 7 Google Analytics Intelligence
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲5613.28 ▼1.291.67 ▼0.3253.70 ▲7.49
Dashboard /wp-admin2,236 ▲454.85 ▼0.0598.52 ▼21.2142.84 ▼3.99
Posts /wp-admin/edit.php2,119 ▲301.99 ▼0.0340.18 ▲2.0437.50 ▲0.51
Add New Post /wp-admin/post-new.php1,559 ▲2423.06 ▼0.17598.81 ▼107.3050.95 ▼11.64
Media Library /wp-admin/upload.php1,415 ▲244.20 ▼0.05101.09 ▼2.0042.51 ▼5.97
Intelligence /wp-admin/admin.php?page=intel_admin8602.3628.9731.97
Setup /wp-admin/admin.php?page=intel_config8602.3627.5029.32
Intelligence /wp-admin/admin.php?page=wpcf7_intel7812.0327.1525.43

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
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • intel_setup
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      include_once(): Failed opening 'INTEL_DIRadmin/intel.admin_setup.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cf7-intelligence/admin/wpcf7_intel.admin_setup.php on line 9
    • > PHP Warning
      include_once(): Failed opening 'INTEL_DIRincludes/intel.wizard.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/cf7-intelligence/admin/wpcf7_intel.admin_setup.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/cf7-intelligence/intel_com/intel.setup.php:396
    • > PHP Warning
      Use of undefined constant INTEL_DIR - assumed 'INTEL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-intelligence/admin/wpcf7_intel.admin_setup.php on line 7
    • > PHP Warning
      Use of undefined constant INTEL_DIR - assumed 'INTEL_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/cf7-intelligence/admin/wpcf7_intel.admin_setup.php on line 9
    • > PHP Warning
      include_once(INTEL_DIRadmin/intel.admin_setup.php): failed to open stream: No such file or directory in wp-content/plugins/cf7-intelligence/admin/wpcf7_intel.admin_setup.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wpcf7_intel() in wp-content/plugins/cf7-intelligence/wpcf7_intel.setup.php:13
    • > PHP Warning
      include_once(INTEL_DIRincludes/intel.wizard.php): failed to open stream: No such file or directory in wp-content/plugins/cf7-intelligence/admin/wpcf7_intel.admin_setup.php on line 7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Donate link: Please fix this invalid url: "getlevelten.com/blog/tom"
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5 in cf7-intelligence/assets to your readme.txt
The official readme.txt might help

cf7-intelligence/wpcf7-intel.php 77% from 13 tests

The primary PHP file in "Contact Form 7 Google Analytics Intelligence" version 1.1.2 is used by WordPress to initiate all plugin functionality
Please take the time to fix the following:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")
  • Main file name: Name the main plugin file the same as the plugin slug ("cf7-intelligence.php" instead of "wpcf7-intel.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin1,549 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP53813611,440
CSS3295103
JavaScript113326

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity31.00
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity4.10
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods29
▷ Static methods310.34%
▷ Public methods2896.55%
▷ Protected methods13.45%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
intel_com/images/icon-128x128.png27.82KB4.74KB▼ 82.95%