68% contact-referal

Code Review | Contact Referal

WordPress plugin Contact Referal scored 68% from 54 tests.

About plugin

  • Plugin page: contact-referal
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.0
  • WordPress version: 6.3.1
  • First release: Apr 11, 2014
  • Latest release: Sep 3, 2014
  • Number of updates: 19
  • Update frequency: every 7.7 days
  • Top authors: pupungbp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 5,358 total downloads

Benchmarks

Plugin footprint 65% 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: ▼1.17MB] [CPU: ▼43.78ms] Passed 4 tests

A check of server-side resources used by Contact Referal
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.77 ▼0.6915.52 ▼29.30
Dashboard /wp-admin2.84 ▼0.4619.13 ▼28.34
Posts /wp-admin/edit.php2.85 ▼0.5119.52 ▼32.66
Add New Post /wp-admin/post-new.php2.84 ▼3.0419.20 ▼84.81
Media Library /wp-admin/upload.php2.84 ▼0.3815.68 ▼19.14
All Contacts /wp-admin/edit.php?post_type=refcontact2.8517.88
Add New /wp-admin/post-new.php?post_type=refcontact2.8517.51
Options /wp-admin/edit.php?post_type=refcontact&page=croptions2.8517.76

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 130 new files
Database: no new tables, 7 new options
New WordPress options
widget_cref_widget
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Contact Referal
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲10313.68 ▼0.951.48 ▼0.8839.57 ▲0.26
Dashboard /wp-admin2,248 ▲574.90 ▲0.03114.47 ▼1.1542.31 ▼3.16
Posts /wp-admin/edit.php2,131 ▲422.03 ▲0.0740.37 ▲0.5635.02 ▼3.84
Add New Post /wp-admin/post-new.php1,553 ▲1123.30 ▲5.11638.98 ▲22.5550.70 ▼14.36
Media Library /wp-admin/upload.php1,430 ▲454.33 ▼0.12104.30 ▲3.8942.08 ▼4.46
All Contacts /wp-admin/edit.php?post_type=refcontact1,1041.9834.1730.08
Add New /wp-admin/post-new.php?post_type=refcontact2,0023.7062.7240.44
Options /wp-admin/edit.php?post_type=refcontact&page=croptions8321.7228.4030.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/contact-referal/inc/session.php+12
    Undefined index: cref_view
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_cref_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=refcontact&page=croptions
    • > Notice in wp-content/plugins/contact-referal/inc/session.php+12
    Undefined index: cref_view
    • > GET request to /wp-admin/post-new.php?post_type=refcontact
    • > User deprecated in wp-includes/functions.php+5828
    Hook dbx_post_advanced is deprecated since version 3.7.0! Use add_meta_boxes instead.
    • > GET request to /wp-admin/post-new.php?post_type=refcontact
    • > Notice in wp-content/plugins/contact-referal/contact-reference.php+127
    Undefined variable: post
    • > GET request to /wp-admin/post-new.php?post_type=refcontact
    • > Notice in wp-content/plugins/contact-referal/contact-reference.php+127
    Trying to get property 'ID' of non-object
    • > GET request to /wp-admin/edit.php?post_type=refcontact&page=croptions
    • > Notice in wp-content/plugins/contact-referal/inc/options.php+15
    Undefined index: settings-updated

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 fix the following items
  • 18× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-referal/lib/metabox/classes.fields.php:581
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-referal/lib/metabox/classes.fields.php:581
    • > PHP Warning
      Use of undefined constant WP_CONTENT_DIR - assumed 'WP_CONTENT_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-referal/lib/metabox/custom-meta-boxes.php on line 46
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/contact-referal/lib/metabox/tests/testGroupField.php:3
    • > PHP Warning
      require_once(/includes/functions.php): failed to open stream: No such file or directory in wp-content/plugins/contact-referal/lib/metabox/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/contact-referal/inc/widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-referal/inc/session.php:8
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-referal/lib/metabox/tests/bootstrap.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-referal/inc/options.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-referal/lib/metabox/classes.fields.php:581

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (/assets/screenshot-1.jpg)
The official readme.txt might help

contact-referal/contact-reference.php 92% from 13 tests

The main file in "Contact Referal" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("contact-referal.php" instead of "contact-reference.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected8,620 lines of code in 95 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript517616523,399
CSS183081582,967
PHP158884551,725
PO File36264178
SVG100135
Markdown346093
JSON20057
Bourne Shell121052
XML10014

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity8.65
▷ Minimum class complexity1.00
▷ Maximum class complexity61.00
Average method complexity2.75
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes13.85%
▷ Concrete classes2596.15%
▷ Final classes00.00%
Methods114
▷ Static methods21.75%
▷ Public methods11096.49%
▷ Protected methods10.88%
▷ Private methods32.63%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
18 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/metabox/images/cmb-icon-remove@2x.png1.14KB0.23KB▼ 79.47%
lib/metabox/css/vendor/jquery-ui/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%
lib/metabox/css/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
lib/metabox/css/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%
lib/metabox/js/select2/select2x2.png0.83KB0.77KB▼ 6.15%