78% magic-tooltips-for-contact-form-7

Code Review | Magic Tooltips For Contact Form 7

WordPress plugin Magic Tooltips For Contact Form 7 scored 78% from 54 tests.

About plugin

  • Plugin page: magic-tooltips-fo...
  • Plugin version: 1.0.29
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.1
  • WordPress version: 6.3.1
  • First release: Jan 4, 2017
  • Latest release: Dec 3, 2022
  • Number of updates: 26
  • Update frequency: every 83.0 days
  • Top authors: magicplugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

1,000+ active / 11,317 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by Magic Tooltips For Contact Form 7
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1742.57 ▼2.67
Dashboard /wp-admin3.37 ▲0.0735.46 ▼13.69
Posts /wp-admin/edit.php3.44 ▲0.0837.97 ▼8.33
Add New Post /wp-admin/post-new.php5.61 ▼0.2774.22 ▼53.02
Media Library /wp-admin/upload.php3.37 ▲0.1532.32 ▼2.86
Settings /wp-admin/admin.php?page=magic_tooltips_for_contact_form_73.3530.78
Tooltip Style Generator /wp-admin/admin.php?page=mtfcf7_tooltip_generator3.2527.21
Help /wp-admin/admin.php?page=mtfcf7_tooltip_help3.3529.89

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 57 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
mtfcf7_tooltip_generator
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
mtfcf7_settings

Browser metrics Passed 4 tests

Checking browser requirements for Magic Tooltips For Contact Form 7
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲9213.61 ▼0.972.06 ▼0.0057.23 ▲13.10
Dashboard /wp-admin2,255 ▲644.90 ▲0.02110.48 ▼6.1143.32 ▼2.18
Posts /wp-admin/edit.php2,137 ▲452.03 ▼0.0238.39 ▲1.5035.47 ▲3.01
Add New Post /wp-admin/post-new.php1,552 ▲3823.48 ▲5.82673.61 ▲17.4163.62 ▲8.02
Media Library /wp-admin/upload.php1,437 ▲494.24 ▲0.0196.39 ▼4.9041.63 ▲0.56
Settings /wp-admin/admin.php?page=magic_tooltips_for_contact_form_79182.2024.6528.23
Tooltip Style Generator /wp-admin/admin.php?page=mtfcf7_tooltip_generator1,1812.6867.5946.33
Help /wp-admin/admin.php?page=mtfcf7_tooltip_help8362.0427.0827.32

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
  • This plugin does not fully uninstall, leaving 8 options in the database
    • mtfcf7_settings
    • mtfcf7_tooltip_generator
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mtfcf7_tooltip_help
    • > Notice in wp-content/plugins/magic-tooltips-for-contact-form-7/plugin-index.php+77
    Undefined index: active_form
    • > GET request to /wp-admin/admin.php?page=magic_tooltips_for_contact_form_7
    • > Notice in wp-content/plugins/magic-tooltips-for-contact-form-7/settings.php+199
    Undefined index: custom_css
    • > GET request to /wp-admin/admin.php?page=mtfcf7_tooltip_generator
    • > Notice in wp-content/plugins/magic-tooltips-for-contact-form-7/css-generator.php+76
    Undefined index: deps
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mtfcf7_tooltip_generator
    • > Notice in wp-content/plugins/magic-tooltips-for-contact-form-7/css-generator.php+91
    Undefined index: ver

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 take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-tooltips-for-contact-form-7/help.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-tooltips-for-contact-form-7/css-generator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/magic-tooltips-for-contact-form-7/settings.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
4 plugin tags: tooltips, contact form 7, responsive, mobile friendly

magic-tooltips-for-contact-form-7/plugin-index.php 85% from 13 tests

The main PHP script in "Magic Tooltips For Contact Form 7" version 1.0.29 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("magic-tooltips-for-contact-form-7.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 Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected10,924 lines of code in 33 files:
LanguageFilesBlank linesComment linesLines of code
CSS112351493,754
JavaScript128147243,574
SVG1002,671
PHP8332374913
Markdown17012

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity16.67
▷ Minimum class complexity6.00
▷ Maximum class complexity34.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods45
▷ Static methods24.44%
▷ Public methods45100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions33
▷ Named functions33100.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

All PNG images should be compressed to minimize bandwidth usage for end users
13 PNG files occupy 0.55MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/tooltip-style-generator/img/bg.png42.75KB46.99KB0.00%
assets/tooltip-style-generator/img/button.png34.66KB33.96KB▼ 2.00%
screencap-3.png161.38KB42.11KB▼ 73.91%
assets/tooltip-style-generator/img/gradient.png10.11KB8.24KB▼ 18.50%
assets/img/icon.png1.32KB0.84KB▼ 36.03%