10% mj-contact-us

Code Review | MJ Contact us

WordPress plugin MJ Contact us scored 10% from 54 tests.

About plugin

  • Plugin page: mj-contact-us
  • Plugin version: 5.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9
  • WordPress version: 6.3.1
  • First release: Nov 19, 2012
  • Latest release: May 10, 2014
  • Number of updates: 18
  • Update frequency: every 29.8 days
  • Top authors: anildhiman (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active / 24,573 total downloads

Benchmarks

Plugin footprint 5% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/mj-contact-us/files/mj-class-functions.php+633
    Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)`

Server metrics [RAM: ▼1.22MB] [CPU: ▼42.02ms] Passed 4 tests

A check of server-side resources used by MJ Contact us
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.75 ▼0.7113.39 ▼28.51
Dashboard /wp-admin2.79 ▼0.5116.68 ▼26.90
Posts /wp-admin/edit.php2.79 ▼0.5615.83 ▼31.88
Add New Post /wp-admin/post-new.php2.79 ▼3.0917.92 ▼80.80
Media Library /wp-admin/upload.php2.79 ▼0.4414.27 ▼16.15
Stored Data /wp-admin/admin.php?page=mj-store-fields2.7915.30
Contact Field /wp-admin/admin.php?page=mj-contact-fields2.7915.35
Contact US /wp-admin/admin.php?page=mj-mainpage2.7915.28
Contact Forms /wp-admin/admin.php?page=mj-contact-forms2.7915.94

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 32 new files
Database: 3 new tables, 7 new options
New tables
wp_mj_contact_saved_forms
wp_mj_contact_fields
wp_mj_contact_forms
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
widget_recent-posts
MjCon_db_version

Browser metrics Passed 4 tests

An overview of browser requirements for MJ Contact us
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,922 ▲18713.67 ▼0.688.39 ▲6.6339.86 ▼7.02
Dashboard /wp-admin2,245 ▲544.90 ▼0.01111.46 ▲11.4939.20 ▼4.35
Posts /wp-admin/edit.php2,131 ▲422.09 ▲0.0342.06 ▲5.1735.60 ▲2.11
Add New Post /wp-admin/post-new.php1,546 ▲817.68 ▼5.39582.89 ▼11.5055.92 ▲5.31
Media Library /wp-admin/upload.php1,427 ▲394.29 ▲0.0294.76 ▼3.0241.08 ▼3.43
Stored Data /wp-admin/admin.php?page=mj-store-fields8241.8929.6524.62
Contact Field /wp-admin/admin.php?page=mj-contact-fields8601.7624.5724.48
Contact US /wp-admin/admin.php?page=mj-mainpage8631.7726.3234.03
Contact Forms /wp-admin/admin.php?page=mj-contact-forms8661.7525.9226.83

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/mj-contact-us/index.php+140
    Non-static method MjFunctions::mj_captcha_init_sessions() should not be called statically
  • This plugin has failed uninstalling correctly, leaving 32 files (2.21MB) in the plugin directory
    • (new file) files/db.php
    • (new file) assets/Thumbs.db
    • (new file) css/mj.css
    • (new file) README.md
    • (new file) .gitignore
    • (new file) assets/screenshot-1.JPG
    • (new file) assets/times_new_yorker.ttf
    • (new file) css/mjCont.css
    • (new file) assets/default.png
    • (new file) files/captcha_code_file.php
    • ...
  • The plugin did not uninstall successfully, leaving 3 tables in the database
    • wp_mj_contact_forms
    • wp_mj_contact_saved_forms
    • wp_mj_contact_fields
  • The uninstall procedure has failed, leaving 8 options in the database
    • recovery_mode_email_last_sent
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • MjCon_db_version
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mj-contact-forms
    • > Deprecated in wp-content/plugins/mj-contact-us/index.php+140
    Non-static method MjFunctions::mj_captcha_init_sessions() should not be called statically

SRP 0% 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
Please take a closer look at the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/mj-contact-us/files/file.php
    • > /wp-content/plugins/mj-contact-us/files/captcha_code_file.php
  • 10× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      imagettftext(): Could not find/open font in wp-content/plugins/mj-contact-us/files/file.php on line 21
    • > PHP Notice
      Undefined index: captcha_type in wp-content/plugins/mj-contact-us/files/captcha_code_file.php on line 87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/mj-contact-us/files/db.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/mj-contact-us/index.php:20
    • > PHP Notice
      Undefined index: total_no_of_characters in wp-content/plugins/mj-contact-us/files/captcha_code_file.php on line 13
    • > PHP Fatal error
      Uncaught Error: Class 'mjContactPRO' not found in wp-content/plugins/mj-contact-us/files/mj-class-html.php:1
    • > PHP Notice
      Undefined index: captcha_type in wp-content/plugins/mj-contact-us/files/captcha_code_file.php on line 55
    • > PHP Warning
      imagettftext(): Could not find/open font in wp-content/plugins/mj-contact-us/files/file.php on line 23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_upload_dir() in wp-content/plugins/mj-contact-us/files/includes.php:4
    • > PHP Notice
      Undefined index: captcha_type in wp-content/plugins/mj-contact-us/files/captcha_code_file.php on line 23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (Simple contact us form screen shot.), #2 (Validation view of form.), #3 (Admin area for setting.4. Add dynamic form area.5. Add only save Data form.6. Manage dynamic created forms.7. Create dynamic fields for forms.8. Manage Fields area.9. Manage Saved form area.)
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

mj-contact-us/index.php 85% from 13 tests

The principal PHP file in "MJ Contact us" v. 5.2.3 is loaded by WordPress automatically on each request
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("mj-contact-us.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 403 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin3,380 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP9302992,053
JavaScript31531401,135
CSS267189
Markdown1103

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity94.00
▷ Minimum class complexity62.00
▷ Maximum class complexity134.00
Average method complexity4.99
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods70
▷ Static methods5477.14%
▷ Public methods6998.57%
▷ Protected methods11.43%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/default.png8.10KB6.82KB▼ 15.79%