94% activitypub

Code Review | ActivityPub

WordPress plugin ActivityPub scored 94% from 54 tests.

About plugin

  • Plugin page: activitypub
  • Plugin version: 0.13.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 5.9.2
  • First release: Sep 24, 2018
  • Latest release: Jan 26, 2022
  • Number of updates: 74
  • Update frequency: every 16.9 days
  • Top authors: pfefferle (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

700+ active / 11,779 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.05MB] [CPU: ▼291.90ms] Passed 4 tests

This is a short check of server-side resources used by ActivityPub
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.0554.05 ▲0.76
Dashboard /wp-admin3.48 ▲0.0735.11 ▼0.90
Posts /wp-admin/edit.php3.70 ▲0.0743.37 ▲1.21
Add New Post /wp-admin/post-new.php6.97 ▲0.0095.14 ▼1,163.19
Media Library /wp-admin/upload.php3.36 ▲0.0723.00 ▼4.27
ActivityPub /wp-admin/options-general.php?page=activitypub3.4230.22
Followers (Fediverse) /wp-admin/users.php?page=activitypub-followers-list3.3626.55

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 32 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for ActivityPub
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,773 ▲1915.70 ▼0.085.69 ▼0.412.02 ▼0.77
Dashboard /wp-admin2,898 ▲486.16 ▲0.02113.57 ▼12.96185.30 ▲20.83
Posts /wp-admin/edit.php2,701 ▲73.24 ▲0.0265.93 ▲1.72150.04 ▲10.32
Add New Post /wp-admin/post-new.php1,667 ▼2316.22 ▼5.35441.18 ▼30.82173.99 ▼26.69
Media Library /wp-admin/upload.php1,711 ▲105.55 ▲0.02140.67 ▼3.90195.94 ▲11.37
ActivityPub /wp-admin/options-general.php?page=activitypub1,4862.4683.08157.32
Followers (Fediverse) /wp-admin/users.php?page=activitypub-followers-list1,0542.3855.03111.44

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 11× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/activitypub/templates/followers-list.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Server' not found in wp-content/plugins/activitypub/includes/rest/class-server.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post() in wp-content/plugins/activitypub/templates/post-json.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_the_author_meta() in wp-content/plugins/activitypub/templates/author-json.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/activitypub/templates/settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Activitypub\\get_context() in wp-content/plugins/activitypub/templates/blog-json.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/activitypub/activitypub.php:83
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/activitypub/includes/table/followers-list.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Activitypub\\add_filter() in wp-content/plugins/activitypub/includes/debug.php:16
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/activitypub/includes/table/followers-list.php on line 5

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

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: fediverse, activitypub, activitystream, ostatus

activitypub/activitypub.php 92% from 13 tests

The main file in "ActivityPub" v. 0.13.3 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:
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin2,309 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP295837442,309

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity9.05
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces6
Interfaces0
Traits0
Classes21
▷ Abstract classes00.00%
▷ Concrete classes21100.00%
▷ Final classes00.00%
Methods115
▷ Static methods8674.78%
▷ Public methods115100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions23
▷ Named functions1773.91%
▷ Anonymous functions626.09%
Constants6
▷ Global constants350.00%
▷ Class constants350.00%
▷ Public constants3100.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 were not PNG files found in your plugin