94% embed-mastodon

Code Review | Mastodon Embed

WordPress plugin Mastodon Embed scored 94% from 54 tests.

About plugin

  • Plugin page: embed-mastodon
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 1.3-1.3
  • WordPress version: 5.9.2
  • First release: Apr 7, 2017
  • Latest release: Apr 13, 2017
  • Number of updates: 3
  • Update frequency: every 1.7 days
  • Top authors: davidlibeau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active / 3,112 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼293.68ms] Passed 4 tests

A check of server-side resources used by Mastodon Embed
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0156.77 ▲7.13
Dashboard /wp-admin3.45 ▲0.0133.82 ▼0.08
Posts /wp-admin/edit.php3.68 ▲0.0138.95 ▲2.27
Add New Post /wp-admin/post-new.php6.92 ▼0.0891.12 ▼1,176.33
Media Library /wp-admin/upload.php3.33 ▲0.0123.91 ▼0.57

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Mastodon Embed
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲916.21 ▲0.436.34 ▼0.482.42 ▼0.43
Dashboard /wp-admin2,895 ▲346.15 ▼0.03122.68 ▼16.67158.17 ▼1.17
Posts /wp-admin/edit.php2,694 ▼03.23 ▼0.0063.90 ▲3.42142.28 ▼0.59
Add New Post /wp-admin/post-new.php1,661 ▼016.09 ▲0.21428.98 ▲16.70153.36 ▲6.55
Media Library /wp-admin/upload.php1,698 ▼05.53 ▲0.06141.71 ▼3.40186.71 ▲2.97

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/embed-mastodon/mastodon-embed.php:54

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: status, mastodon, embed, gnu social

embed-mastodon/mastodon-embed.php 92% from 13 tests

The main PHP script in "Mastodon Embed" version 1.3 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("embed-mastodon.php" instead of "mastodon-embed.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin35 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP112735

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
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%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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