78% wp-mastodon-share

Code Review | Mastodon Auto Share

WordPress plugin Mastodon Auto Share scored78%from 54 tests.

About plugin

  • Plugin page: wp-mastodon-share
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 25, 2017
  • Latest release: May 30, 2022
  • Number of updates: 42
  • Update frequency: every 42.1 days
  • Top authors: kernox (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

200+ active /5,426 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.61MB] [CPU: ▼16.53ms] Passed 4 tests

Analyzing server-side resources used by Mastodon Auto Share
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0837.08 ▼5.38
Dashboard /wp-admin3.39 ▲0.0458.96 ▼9.95
Posts /wp-admin/edit.php3.50 ▲0.1455.06 ▲5.45
Add New Post /wp-admin/post-new.php3.23 ▼2.6541.96 ▼48.37
Media Library /wp-admin/upload.php3.31 ▲0.0833.32 ▼2.40
Mastodon Auto Share /wp-admin/options-general.php?page=wp-mastodon-share3.5637.55

Server storage [IO: ▲0.15MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • The plugin illegally modified 1 file (4.00KB) outside of "wp-content/plugins/wp-mastodon-share/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 22 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Mastodon Auto Share
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲7313.33 ▼0.941.61 ▼0.0441.00 ▲0.36
Dashboard /wp-admin2,225 ▲185.83 ▲0.9296.17 ▼16.7440.04 ▼4.63
Posts /wp-admin/edit.php2,104 ▲41.97 ▲0.0039.81 ▲2.0135.03 ▼3.81
Add New Post /wp-admin/post-new.php6,264 ▲4,72426.08 ▲2.97830.26 ▲124.6156.22 ▼10.20
Media Library /wp-admin/upload.php1,407 ▲104.24 ▼0.01100.45 ▼5.6347.35 ▲2.41
Mastodon Auto Share /wp-admin/options-general.php?page=wp-mastodon-share4,7842.2528.1927.58

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-mastodon-share/instanceList.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-mastodon-share/wp-mastodon-share.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/wp-mastodon-share/form.tpl.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed: The official readme.txt might help

wp-mastodon-share/wp-mastodon-share.php Passed 13 tests

The main file in "Mastodon Auto Share" v. 1.4 serves as a complement to information provided in readme.txt and as the entry point to the plugin
45 characters long description:
Share WordPress posts on a mastodon instance.

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
No dangerous file extensions were detected1,191 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP513774556
SVG504191
JavaScript3475173
CSS1360160
PO File23640107
Markdown1304

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.20
Average class complexity16.00
▷ Minimum class complexity3.00
▷ Maximum class complexity29.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2284.62%
▷ Protected methods00.00%
▷ Private methods415.38%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There are no PNG files in this plugin