84% contact-form-7-salesking-crm-addon

Code Review | Contact Form 7 - SalesKing CRM Addon

WordPress plugin Contact Form 7 - SalesKing CRM Addon scored84%from 54 tests.

About plugin

  • Plugin page: contact-form-7-sa...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-3.5.2
  • WordPress version: 6.3.1
  • First release: Jul 16, 2013
  • Latest release: Apr 14, 2014
  • Number of updates: 33
  • Update frequency: every 8.3 days
  • Top authors: killer-g (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,625 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.53ms] Passed 4 tests

A check of server-side resources used by Contact Form 7 - SalesKing CRM Addon
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.82 ▼2.04
Dashboard /wp-admin3.31 ▲0.0049.65 ▼3.86
Posts /wp-admin/edit.php3.36 ▲0.0051.63 ▼3.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.45 ▼16.84
Media Library /wp-admin/upload.php3.23 ▲0.0038.27 ▲2.08

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 49 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contact Form 7 - SalesKing CRM Addon
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.34 ▼0.191.98 ▼0.2545.54 ▲0.96
Dashboard /wp-admin2,198 ▲185.57 ▼0.0993.21 ▼4.0337.93 ▼3.59
Posts /wp-admin/edit.php2,097 ▼31.95 ▼0.0339.87 ▲3.2535.26 ▲1.67
Add New Post /wp-admin/post-new.php1,526 ▼023.29 ▼0.27693.29 ▼1.3859.22 ▲3.14
Media Library /wp-admin/upload.php1,403 ▲94.11 ▼0.10116.30 ▲9.3846.45 ▲0.77

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/contact-form-7-salesking-crm-addon/cf7-salesking.php on line 38
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_plugin_active() in wp-content/plugins/contact-form-7-salesking-crm-addon/cf7-salesking.php:40
    • > PHP Fatal error
      Uncaught Exception: missing salesking.php library file in wp-content/plugins/contact-form-7-salesking-crm-addon/vendor/salesking/object.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-form-7-salesking-crm-addon/models/sk_cf.class.php:4
    • > PHP Fatal error
      Uncaught Exception: missing salesking.php library file in wp-content/plugins/contact-form-7-salesking-crm-addon/vendor/salesking/collection.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/contact-form-7-salesking-crm-addon/models/sk_cf_admin.class.php:6
    • > PHP Fatal error
      Uncaught Exception: missing salesking.php library file in wp-content/plugins/contact-form-7-salesking-crm-addon/vendor/salesking/helper.php:12
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-form-7-salesking-crm-addon/cf7-salesking.php on line 38
    • > PHP Warning
      include_once(ABSPATHwp-admin/includes/plugin.php): failed to open stream: No such file or directory in wp-content/plugins/contact-form-7-salesking-crm-addon/cf7-salesking.php on line 38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Activate the SalesKing integration on a form), #2 (Map fields collected by a form)
You can look at the official readme.txt

contact-form-7-salesking-crm-addon/cf7-salesking.php 92% from 13 tests

The principal PHP file in "Contact Form 7 - SalesKing CRM Addon" v. 1.1.0 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("contact-form-7-salesking-crm-addon.php" instead of "cf7-salesking.php")

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
No dangerous file extensions were detected6,886 lines of code in 41 files:
LanguageFilesBlank linesComment linesLines of code
JSON32805,721
PHP82297341,110
JavaScript19355

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity22.12
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity3.28
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods74
▷ Static methods34.05%
▷ Public methods7094.59%
▷ Protected methods00.00%
▷ Private methods45.41%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png86.00KB30.90KB▼ 64.06%
screenshot-1.png29.55KB11.56KB▼ 60.89%