77% post-bot

Code Review | Post Bot

WordPress plugin Post Bot scored77%from 54 tests.

About plugin

  • Plugin page: post-bot
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.0.3
  • WordPress version: 6.3.1
  • First release: Jun 18, 2020
  • Latest release: Nov 1, 2022
  • Number of updates: 8
  • Update frequency: every 108.5 days
  • Top authors: aasthasolutions (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /725 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼5.52ms] Passed 4 tests

A check of server-side resources used by Post Bot
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.82 ▲0.58
Dashboard /wp-admin3.38 ▲0.0448.01 ▼10.30
Posts /wp-admin/edit.php3.43 ▲0.0846.08 ▲2.65
Add New Post /wp-admin/post-new.php5.96 ▲0.0884.36 ▼14.27
Media Library /wp-admin/upload.php3.30 ▲0.0837.23 ▲1.93

Server storage [IO: ▲0.22MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Post Bot
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15513.36 ▼1.198.45 ▲6.7246.33 ▲1.58
Dashboard /wp-admin2,208 ▲275.50 ▼0.2188.33 ▼8.8039.60 ▲0.40
Posts /wp-admin/edit.php2,113 ▲132.00 ▲0.0532.93 ▼7.6034.31 ▼4.85
Add New Post /wp-admin/post-new.php1,539 ▲1323.37 ▲0.32668.44 ▲61.3754.99 ▲1.16
Media Library /wp-admin/upload.php1,416 ▲224.14 ▲0.02107.92 ▲12.0848.72 ▲7.22

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/post-bot/includes/front.php
    • > /wp-content/plugins/post-bot/includes/admin.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/post-bot/includes/admin.php on line 12
    • > PHP Notice
      Undefined variable: roles in wp-content/plugins/post-bot/includes/admin.php on line 15
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/post-bot/includes/admin.php on line 16
    • > PHP Notice
      Undefined variable: roles in wp-content/plugins/post-bot/includes/admin.php on line 12
    • > PHP Warning
      Use of undefined constant ASPC_IMG_URL - assumed 'ASPC_IMG_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-bot/includes/front.php on line 6
    • > PHP Warning
      Use of undefined constant ASPC_PLUGIN_URL - assumed 'ASPC_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/post-bot/includes/front.php on line 11
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/post-bot/includes/admin.php on line 14
    • > PHP Warning
      in_array() expects parameter 2 to be array, null given in wp-content/plugins/post-bot/includes/admin.php on line 13
    • > PHP Notice
      Undefined variable: roles in wp-content/plugins/post-bot/includes/admin.php on line 13
    • > PHP Notice
      Undefined variable: roles in wp-content/plugins/post-bot/includes/admin.php on line 16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Requires php: Version not formatted correctly
  • Screenshots: Please add an image for screenshot #1 (Once plugin is activated click on Post bot on left navigation and choose user role.)
  • Contributors: Plugin contributors not specified
You can take inspiration from this readme.txt

post-bot/post-bot.php 92% from 13 tests

The main file in "Post Bot" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 173 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin782 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP41351400
CSS21517218
JavaScript1310164

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.47
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%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
3 PNG files occupy 0.02MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/LogoBot.png12.52KB4.29KB▼ 65.74%
assets/images/arrow4.png2.70KB0.41KB▼ 84.92%
assets/images/ChatBox.png7.27KB2.79KB▼ 61.55%