84% emercury-extension-for-contact-form-7

Code Review | Emercury Extension For Contact Form 7

WordPress plugin Emercury Extension For Contact Form 7 scored84%from 54 tests.

About plugin

  • Plugin page: emercury-extensio...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.8.1
  • WordPress version: 6.3.1
  • First release: Dec 7, 2020
  • Latest release: Oct 7, 2021
  • Number of updates: 7
  • Update frequency: every 122.9 days
  • Top authors: emercury (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /420 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.00MB] [CPU: ▼11.45ms] Passed 4 tests

An overview of server-side resources used by Emercury Extension For Contact Form 7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.98 ▲2.20
Dashboard /wp-admin3.31 ▲0.0047.12 ▼8.31
Posts /wp-admin/edit.php3.36 ▲0.0046.12 ▼4.43
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.26 ▼25.75
Media Library /wp-admin/upload.php3.23 ▲0.0035.81 ▼7.29

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for Emercury Extension For Contact Form 7
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.311.66 ▲0.1143.63 ▲1.75
Dashboard /wp-admin2,195 ▲185.63 ▼0.0490.38 ▼4.4738.87 ▼6.44
Posts /wp-admin/edit.php2,100 ▼01.97 ▼0.0134.80 ▼1.3633.01 ▼1.65
Add New Post /wp-admin/post-new.php1,526 ▼023.30 ▼0.34664.71 ▼15.6061.60 ▲1.42
Media Library /wp-admin/upload.php1,400 ▼04.21 ▲0.1096.92 ▼9.1144.02 ▼0.31

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
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

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
Even though no errors were found, this is by no means 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
The following issues need your attention
  • 9× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_get_theme() in wp-content/plugins/emercury-extension-for-contact-form-7/includes/system.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/emercury-extension-for-contact-form-7/includes/view.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/emercury-extension-for-contact-form-7/emercury-extension-cf7.php:38
    • > PHP Notice
      Undefined variable: em_invalid in wp-content/plugins/emercury-extension-for-contact-form-7/includes/view.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/emercury-extension-for-contact-form-7/includes/find.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/emercury-extension-for-contact-form-7/includes/view_fields.php:3
    • > PHP Warning
      Use of undefined constant EMERCURY_EXTENSION_CF7_HELP_URL - assumed 'EMERCURY_EXTENSION_CF7_HELP_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/emercury-extension-for-contact-form-7/includes/view.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/emercury-extension-for-contact-form-7/includes/tools.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/emercury-extension-for-contact-form-7/includes/handler.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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: These screenshots do not have images: #1 (Emercury Settings.), #2 (Emercury API Key.), #3 (Emercury Lists.), #4 (Emercury Mapping.)
The official readme.txt is a good inspiration

emercury-extension-for-contact-form-7/emercury-extension-cf7.php 92% from 13 tests

Analyzing the main PHP file in "Emercury Extension For Contact Form 7" version 1.0.0
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("emercury-extension-for-contact-form-7.php" instead of "emercury-extension-cf7.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,223 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP930634947
CSS1440168
JavaScript1220108

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity9.00
▷ Minimum class complexity5.00
▷ Maximum class complexity13.00
Average method complexity2.07
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods16.67%
▷ Public methods1386.67%
▷ Protected methods00.00%
▷ Private methods213.33%
Functions35
▷ Named functions3394.29%
▷ Anonymous functions25.71%
Constants10
▷ Global constants880.00%
▷ Class constants220.00%
▷ Public constants2100.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
4 PNG files occupy 0.19MB with 0.11MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png21.55KB10.07KB▼ 53.26%
screenshot-1.png82.86KB34.88KB▼ 57.90%
screenshot-4.png60.39KB24.55KB▼ 59.35%
screenshot-3.png25.51KB10.13KB▼ 60.29%