90% share-on-mastodon

Code Review | Share on Mastodon

WordPress plugin Share on Mastodon scored90%from 54 tests.

About plugin

  • Plugin page: share-on-mastodon
  • Plugin version: 0.17.2
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.4
  • WordPress version: 6.3.1
  • First release: Nov 17, 2019
  • Latest release: Nov 9, 2023
  • Number of updates: 34
  • Update frequency: every 43.0 days
  • Top authors: janboddez (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /12,658 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.41MB] [CPU: ▼8.46ms] Passed 4 tests

An overview of server-side resources used by Share on Mastodon
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.88 ▲0.4151.30 ▼0.71
Dashboard /wp-admin3.72 ▲0.4149.91 ▲4.03
Posts /wp-admin/edit.php3.84 ▲0.4748.08 ▼14.64
Add New Post /wp-admin/post-new.php6.28 ▲0.3995.54 ▼18.23
Media Library /wp-admin/upload.php3.64 ▲0.4138.52 ▼0.26
Share on Mastodon /wp-admin/options-general.php?page=share-on-mastodon3.6133.80

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 16 new files
Database: no new tables, 7 new options
New WordPress options

Browser metrics Passed 4 tests

Share on Mastodon: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.67 ▲0.512.19 ▲0.0245.35 ▼4.61
Dashboard /wp-admin2,202 ▲255.62 ▲0.04100.05 ▼6.1441.61 ▼2.07
Posts /wp-admin/edit.php2,107 ▲41.95 ▼0.0637.78 ▼7.5135.73 ▼1.91
Add New Post /wp-admin/post-new.php1,715 ▲18925.18 ▲2.17618.67 ▼50.8334.72 ▼21.02
Media Library /wp-admin/upload.php1,407 ▲104.28 ▲0.1297.10 ▼30.5041.55 ▼6.44
Share on Mastodon /wp-admin/options-general.php?page=share-on-mastodon8711.9724.2129.45

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • share_on_mastodon_settings
    • db_upgraded
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP Passed 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
The SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: fediverse, share, crosspost, syndication, publicize...

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

The main PHP file in "Share on Mastodon" ver. 0.17.2 adds more information about the plugin and also serves as the entry point for this plugin
41 characters long description:
Easily share WordPress posts on Mastodon.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,798 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity33.75
▷ Minimum class complexity3.00
▷ Maximum class complexity98.00
Average method complexity4.97
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
▷ Static methods2233.85%
▷ Public methods5076.92%
▷ Protected methods913.85%
▷ Private methods69.23%
▷ Named functions342.86%
▷ Anonymous functions457.14%
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin