66% magic-conversation-for-gravity-forms

Code Review | Magic Conversation For Gravity Forms

WordPress plugin Magic Conversation For Gravity Forms scored 66% from 54 tests.

About plugin

  • Plugin page: magic-conversatio...
  • Plugin version: 3.0.93
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.1
  • WordPress version: 6.3.1
  • First release: Feb 9, 2017
  • Latest release: Dec 3, 2022
  • Number of updates: 66
  • Update frequency: every 32.2 days
  • Top authors: magicplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 3,313 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.27MB] [CPU: ▼1.58ms] Passed 4 tests

Analyzing server-side resources used by Magic Conversation For Gravity Forms
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1221.54 ▼15.50
Dashboard /wp-admin3.68 ▲0.3848.60 ▼3.22
Posts /wp-admin/edit.php3.73 ▲0.3755.89 ▲9.69
Add New Post /wp-admin/post-new.php6.19 ▲0.3196.11 ▲2.75
Media Library /wp-admin/upload.php3.52 ▲0.2941.75 ▲9.64
Conversation Style Generator /wp-admin/admin.php?page=mcfgf_conversation_generator3.4933.63
Settings /wp-admin/admin.php?page=magic_conversation_for_gravity_forms3.5138.09
Help /wp-admin/admin.php?page=mcfgf_tooltip_help3.5137.86

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 295 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
mcfgf_conversation_generator
mcfgf_basics
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
mcfgf_settings

Browser metrics Passed 4 tests

Magic Conversation For Gravity Forms: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,141 ▲40617.86 ▲3.577.55 ▲5.9237.56 ▼1.94
Dashboard /wp-admin2,425 ▲2348.65 ▲3.74166.70 ▲65.0840.79 ▼6.16
Posts /wp-admin/edit.php2,331 ▲2455.77 ▲3.7272.20 ▲35.8934.93 ▲3.82
Add New Post /wp-admin/post-new.php1,743 ▲22926.33 ▲8.88574.33 ▼102.5927.59 ▼34.63
Media Library /wp-admin/upload.php1,467 ▲826.03 ▲1.8994.03 ▼15.1340.73 ▼7.18
Conversation Style Generator /wp-admin/admin.php?page=mcfgf_conversation_generator1,6595.5573.83125.69
Settings /wp-admin/admin.php?page=magic_conversation_for_gravity_forms2,7796.29102.4631.08
Help /wp-admin/admin.php?page=mcfgf_tooltip_help1,0985.4854.4526.42

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 9 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • mcfgf_conversation_generator
    • widget_theysaidso_widget
    • can_compress_scripts
    • mcfgf_settings
    • mcfgf_basics
    • widget_recent-comments

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=mcfgf_conversation_generator
    • > Notice in wp-content/plugins/magic-conversation-for-gravity-forms/css-generator.php+393
    Undefined index: conversation_gravity_form_id
    • > GET request to /wp-admin/admin.php?page=mcfgf_conversation_generator
    • > Notice in wp-content/plugins/magic-conversation-for-gravity-forms/css-generator.php+398
    Undefined variable: ver
    • > GET request to /wp-admin/admin.php?page=mcfgf_conversation_generator
    • > Notice in wp-content/plugins/magic-conversation-for-gravity-forms/css-generator.php+174
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/magic-conversation-for-gravity-forms/url_preview.php
    • > /wp-content/plugins/magic-conversation-for-gravity-forms/yakker-form.php
    • > /wp-content/plugins/magic-conversation-for-gravity-forms/woo_products.php
    • > /wp-content/plugins/magic-conversation-for-gravity-forms/yakker-mcfwc.php
  • 35× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/layershifter/tld-support/tests/Helpers/ArrTest.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/magic-conversation-for-gravity-forms/functions.php:382
    • > PHP Fatal error
      Uncaught Error: Interface 'LayerShifter\\TLDExtract\\ResultInterface' not found in wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/layershifter/tld-extract/src/Result.php:27
    • > PHP Fatal error
      Uncaught ReflectionException: Class WeDevs_Settings_API does not exist in wp-content/plugins/magic-conversation-for-gravity-forms/settings.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CPT' not found in wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/jjgrainger/wp-custom-post-type-class/examples/books-post-type.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'LayerShifter\\TLDDatabase\\Exceptions\\Exception' not found in wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/layershifter/tld-database/src/Exceptions/HttpException.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-conversation-for-gravity-forms/upgrade.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'LayerShifter\\TLDDatabase\\Exceptions\\Exception' not found in wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/layershifter/tld-database/src/Exceptions/IOException.php:16
    • > PHP Warning
      require(wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/layershifter/tld-support/tests/../vendor/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/magic-conversation-for-gravity-forms/lib/vendor/layershifter/tld-support/tests/bootstrap.php on line 11
    • > PHP Notice
      Undefined index: HTTP_ORIGIN in wp-content/plugins/magic-conversation-for-gravity-forms/woo_products.php on line 8

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=mcfgf_conversation_generator
    • > Network (severe)
    magic-conversation/0/?lang=&ver= - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
4 plugin tags: conversational form, mobile friendly, contact form, responsive

magic-conversation-for-gravity-forms/plugin-index.php 85% from 13 tests

"Magic Conversation For Gravity Forms" version 3.0.93's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("magic-conversation-for-gravity-forms.php" instead of "plugin-index.php")
  • Requires at least: The required version number must match the one declared in readme.txt ("3.2" instead of "3.9")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected64,307 lines of code in 206 files:
LanguageFilesBlank linesComment linesLines of code
PHP972,7704,34538,972
JavaScript402,1553,06713,886
CSS296322767,847
HTML11266812,173
JSON1500959
Markdown101790386
SVG128331
YAML27028
XML11025

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity should be reduced to less than 100 (currently 179)
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity24.34
▷ Minimum class complexity1.00
▷ Maximum class complexity179.00
Average method complexity4.01
▷ Minimum method complexity1.00
▷ Maximum method complexity179.00
Code structure
Namespaces14
Interfaces2
Traits0
Classes51
▷ Abstract classes23.92%
▷ Concrete classes4996.08%
▷ Final classes1326.53%
Methods415
▷ Static methods10425.06%
▷ Public methods37991.33%
▷ Protected methods10.24%
▷ Private methods358.43%
Functions190
▷ Named functions17893.68%
▷ Anonymous functions126.32%
Constants165
▷ Global constants8652.12%
▷ Class constants7947.88%
▷ Public constants79100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
47 PNG files occupy 0.84MB with 0.23MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/html/img/upload-button@2x.png0.40KB0.40KB0.00%
assets/avatars/6.png11.61KB7.20KB▼ 37.97%
assets/img/dismiss.png0.15KB0.15KB▼ 1.92%
assets/avatars/4.png21.78KB9.54KB▼ 56.18%
assets/avatars/2.png12.26KB7.20KB▼ 41.30%