78% autopost-to-mastodon

Code Review | Mastodon Autopost

WordPress plugin Mastodon Autopost scored 78% from 54 tests.

About plugin

  • Plugin page: autopost-to-mastodon
  • Plugin version: 3.7
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2017
  • Latest release: May 7, 2023
  • Number of updates: 62
  • Update frequency: every 34.8 days
  • Top authors: l1am0 (100%)

Code review

54 tests

User reviews

20 reviews

Install metrics

1,000+ active / 19,213 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.82ms] Passed 4 tests

A check of server-side resources used by Mastodon Autopost
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1442.01 ▲1.60
Dashboard /wp-admin3.42 ▲0.1150.58 ▼3.31
Posts /wp-admin/edit.php3.53 ▲0.1757.02 ▲9.42
Add New Post /wp-admin/post-new.php6.00 ▲0.1290.06 ▼11.23
Media Library /wp-admin/upload.php3.34 ▲0.1140.64 ▲5.66
Mastodon Autopost /wp-admin/options-general.php?page=autopost-to-mastodon3.9744.27

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
autopostToMastodon-notice
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Mastodon Autopost
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲8513.24 ▼1.135.94 ▲4.1441.75 ▼4.03
Dashboard /wp-admin2,226 ▲444.88 ▲0.04110.17 ▲2.4142.14 ▼1.45
Posts /wp-admin/edit.php2,108 ▲192.07 ▲0.0742.04 ▲2.9136.19 ▲0.06
Add New Post /wp-admin/post-new.php6,474 ▲4,96020.06 ▲2.46890.89 ▲229.3465.92 ▼1.04
Media Library /wp-admin/upload.php1,408 ▲204.22 ▼0.0295.20 ▼8.7942.27 ▼6.22
Mastodon Autopost /wp-admin/options-general.php?page=autopost-to-mastodon9,4272.2632.1629.39

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means 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
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/autopost-to-mastodon/instanceList.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/autopost-to-mastodon/form.tpl.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/autopost-to-mastodon/mastodon_autopost.php:20

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

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
8 plugin tags: social media, mastodon, statusnet, auto post, gnu social...

autopost-to-mastodon/mastodon_autopost.php 92% from 13 tests

The main PHP file in "Mastodon Autopost" ver. 3.7 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("autopost-to-mastodon.php" instead of "mastodon_autopost.php")

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 plugin1,313 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP5170100780
SVG504191
CSS1360160
PO File2740150
JavaScript15432

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity33.50
▷ Minimum class complexity7.00
▷ Maximum class complexity60.00
Average method complexity3.32
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods2278.57%
▷ Protected methods00.00%
▷ Private methods621.43%
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/paypal.png12.65KB5.27KB▼ 58.33%
img/patron.png3.01KB1.62KB▼ 46.14%