10% contact-bot

Code Review | Contact Bot

WordPress plugin Contact Bot scored10%from 54 tests.

About plugin

  • Plugin page: contact-bot
  • Plugin version: 1.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.5
  • WordPress version: 6.3.1
  • First release: Apr 22, 2016
  • Latest release: Nov 22, 2016
  • Number of updates: 17
  • Update frequency: every 12.6 days
  • Top authors: ty_pwd (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

20+ active /2,944 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/contact-bot/contactbot.php+29
    Constant MCB_PLUGIN_URL already defined

Server metrics [RAM: ▼1.96MB] [CPU: ▼55.79ms] Passed 4 tests

Analyzing server-side resources used by Contact Bot
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.433.81 ▼36.10
Dashboard /wp-admin2.05 ▼1.266.32 ▼45.69
Posts /wp-admin/edit.php2.05 ▼1.315.89 ▼42.15
Add New Post /wp-admin/post-new.php2.05 ▼3.845.63 ▼99.20
Media Library /wp-admin/upload.php2.05 ▼1.186.01 ▼27.37
How to use /wp-admin/admin.php?page=mcb-documentation2.055.48
Contact Bot /wp-admin/admin.php?page=mcb-settings2.055.33

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 108 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for Contact Bot
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲21114.19 ▼0.088.18 ▲6.4141.38 ▼3.05
Dashboard /wp-admin2,253 ▲655.32 ▲0.44101.90 ▼10.9742.90 ▼2.56
Posts /wp-admin/edit.php2,140 ▲482.40 ▲0.3938.00 ▼3.5334.29 ▼3.11
Add New Post /wp-admin/post-new.php1,553 ▲2517.76 ▼0.59718.31 ▲112.3035.86 ▼13.94
Media Library /wp-admin/upload.php1,432 ▲414.59 ▲0.4299.04 ▲2.9943.59 ▲2.94
How to use /wp-admin/admin.php?page=mcb-documentation8992.3443.1129.51
Contact Bot /wp-admin/admin.php?page=mcb-settings1,5432.8461.7173.61

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/contact-bot/contactbot.php+29
    Constant MCB_PLUGIN_URL already defined
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=mcb-settings
    • > Notice in wp-content/plugins/contact-bot/contactbot.php+29
    Constant MCB_PLUGIN_URL already defined

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
Almost there! Just fix the following items
  • 17× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'IClient' not found in wp-content/plugins/contact-bot/modules/providers/MCBTelegramClient.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'Aura\\Session\\SegmentInterface' not found in wp-content/plugins/contact-bot/php-lib/Aura.Session/src/Segment.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'MCB_PLUGIN_DIR/modules/providers/IClient.php' (include_path='.:/usr/share/php') in wp-content/plugins/contact-bot/modules/MCBMessenger.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-bot/client/client.php:22
    • > PHP Warning
      Use of undefined constant MCB_PLUGIN_DIR - assumed 'MCB_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/contact-bot/loader.php on line 4
    • > PHP Warning
      require_once(MCB_PLUGIN_DIR/models/MCBUser.php): failed to open stream: No such file or directory in wp-content/plugins/contact-bot/loader.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/contact-bot/client/output.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Aura\\Session\\RandvalInterface' not found in wp-content/plugins/contact-bot/php-lib/Aura.Session/src/Randval.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/contact-bot/contactbot.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'MCBUtils' not found in wp-content/plugins/contact-bot/admin/integrations/telegram.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Please fix the following attributes:
  • Screenshots: Add an image for screenshot #1 (screenshot-3.jpg)
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

contact-bot/contactbot.php 77% from 13 tests

Analyzing the main PHP file in "Contact Bot" version 1.5
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-bot.php" instead of "contactbot.php")
  • Domain Path: The domain path points to a folder that does not exist ("/languages/")

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
Everything looks great! No dangerous files found in this plugin12,424 lines of code in 86 files:
LanguageFilesBlank linesComment linesLines of code
CSS6738484,619
JavaScript185427662,055
Sass1668361,789
LESS1434441,628
PHP304281,2551,628
SVG100685
Markdown17020

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity5.55
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity1.84
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces2
Interfaces3
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes423.53%
Methods107
▷ Static methods1514.02%
▷ Public methods9487.85%
▷ Protected methods54.67%
▷ Private methods87.48%
Functions27
▷ Named functions2281.48%
▷ Anonymous functions518.52%
Constants22
▷ Global constants1359.09%
▷ Class constants940.91%
▷ Public constants9100.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
6 PNG files occupy 0.57MB with 0.42MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/mcb-doc-2.png44.54KB7.57KB▼ 83.00%
images/mcb-doc-1.png92.24KB23.21KB▼ 74.84%
images/telegram-instructions-3.png90.89KB29.46KB▼ 67.59%
images/telegram-instructions-2.png227.28KB72.86KB▼ 67.94%
images/mcb-doc-3.png62.74KB16.26KB▼ 74.07%