10% jcontact

Code Review | jContact

WordPress plugin jContact scored 10% from 54 tests.

About plugin

  • Plugin page: jcontact
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-3.5.1
  • WordPress version: 5.8.1
  • First release: Apr 19, 2013
  • Latest release: Jun 2, 2013
  • Number of updates: 6
  • Update frequency: every 9.7 days
  • Top authors: amitmalakar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 806 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The following installer errors require your attention
  • Install procedure validation failed for this plugin
    • > User deprecated in wp-includes/functions.php+5401
    upgrade-functions.php is deprecated since version 2.5.0! Use wp-admin/includes/upgrade.php instead.

Server metrics [RAM: ▲0.04MB] [CPU: ▼146.21ms] Passed 4 tests

Server-side resources used by jContact
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.88 ▲0.0434.02 ▼5.57
Dashboard /wp-admin3.11 ▲0.0546.69 ▼1.99
Posts /wp-admin/edit.php3.16 ▲0.0450.97 ▲3.99
Add New Post /wp-admin/post-new.php5.46 ▲0.0290.56 ▼574.26
Media Library /wp-admin/upload.php3.05 ▲0.0434.41 ▼3.02
Donate /wp-admin/admin.php?page=donate3.0231.84
User Info /wp-admin/admin.php?page=jc-top-level-handle3.0333.97
Email Templates /wp-admin/admin.php?page=email3.0327.58

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: 2 new tables, 1 new option
New tables
wp_jc_users
wp_jc_email_templates
New WordPress options
recovery_mode_email_last_sent

Browser metrics Passed 4 tests

Checking browser requirements for jContact
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,716 ▲12016.26 ▲0.699.60 ▲0.5950.19 ▼5.22
Dashboard /wp-admin2,998 ▲675.87 ▼0.07143.12 ▼6.44145.17 ▲27.26
Posts /wp-admin/edit.php2,795 ▲592.70 ▲0.0167.25 ▼3.0497.32 ▼1.49
Add New Post /wp-admin/post-new.php1,708 ▲2518.75 ▼0.02391.19 ▲8.24125.66 ▲13.82
Media Library /wp-admin/upload.php1,786 ▼215.02 ▼0.03141.09 ▼59.67144.71 ▲14.57
Donate /wp-admin/admin.php?page=donate1,1762.0954.5278.34
User Info /wp-admin/admin.php?page=jc-top-level-handle1,0152.1137.5158.85
Email Templates /wp-admin/admin.php?page=email1,2462.0657.0769.78

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • The plugin did not uninstall correctly, leaving 30 files (0.05MB) in the plugin directory
    • (new file) images/btn_up_arrow.gif
    • (new file) images/Close_Box_Red.png
    • (new file) images/ajax2.gif
    • (new file) images/dialog-close.png
    • (new file) images/delete.png
    • (new file) images/b_edit.png
    • (new file) images/J.png
    • (new file) images/ajax.gif
    • (new file) images/active_bg.png
    • (new file) css/.empty
    • ...
  • This plugin did not uninstall successfully, leaving 1 option in the database
    • recovery_mode_email_last_sent

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=jc-top-level-handle
    • > Error in wp-content/plugins/jcontact/jc_userinfo.php+47
    Uncaught Error: Call to undefined function mysql_error() in wp-content/plugins/jcontact/jc_userinfo.php:47
    Stack trace:
    #0 wp-content/plugins/jcontact/jc_main.php(132): include()
    #1 wp-includes/class-wp-hook.php(303): jc_userinfo()
    #2 wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(470): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 {main}
    thrown
    • > GET request to /wp-admin/admin.php?page=email
    • > Notice in wp-content/plugins/jcontact/jc_email_template.php+3
    Undefined index: email_submit

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/jcontact/jc_email_template.php:36
    • > PHP Notice
      Undefined index: email_submit in wp-content/plugins/jcontact/jc_email_template.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_column_headers() in wp-content/plugins/jcontact/jc_donate.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/jcontact/jc_main.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/jcontact/jc_userinfo.php:3
    • > PHP Warning
      Use of undefined constant JC_TABLE_EMAIL - assumed 'JC_TABLE_EMAIL' (this will throw an Error in a future version of PHP) in wp-content/plugins/jcontact/jc_email_template.php on line 35
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/jcontact/jc_ui_form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: decline, contact form, javascript, ajax, status...

jcontact/jc_main.php 92% from 13 tests

Analyzing the main PHP file in "jContact" version 1.0
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("jcontact.php" instead of "jc_main.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
There were no executable files found in this plugin550 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP65054550

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.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
14 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/jg_images/opa75.png0.11KB0.09KB▼ 13.64%
images/jg_images/ad_scroll_back.png0.23KB0.17KB▼ 29.17%
images/active_bg.png1.99KB3.11KB0.00%
images/jg_images/ad_next.png0.35KB0.26KB▼ 25.35%
images/dialog-close.png0.86KB0.86KB0.00%