73% pterotype

Code Review | Pterotype

WordPress plugin Pterotype scored73%from 54 tests.

About plugin

  • Plugin page: pterotype
  • Plugin version: 1.4.3
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-5.1.1
  • WordPress version: 6.3.1
  • First release: Oct 21, 2018
  • Latest release: Mar 15, 2019
  • Number of updates: 30
  • Update frequency: every 4.8 days
  • Top authors: jdormit (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,048 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▼0.60MB] [CPU: ▼19.64ms] Passed 4 tests

An overview of server-side resources used by Pterotype
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1140.86 ▼1.73
Dashboard /wp-admin3.39 ▲0.0452.10 ▼16.00
Posts /wp-admin/edit.php3.52 ▲0.1652.57 ▲1.12
Add New Post /wp-admin/post-new.php3.25 ▼2.6338.44 ▼61.93
Media Library /wp-admin/upload.php3.31 ▲0.0838.35 ▲3.89

Server storage [IO: ▲1.80MB] [DB: ▲0.02MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • Illegal file modification found: 1 file (1.00KB) outside of "wp-content/plugins/pterotype/" and "wp-content/uploads/"
    • (new file) wp-admin/.rnd
Filesystem: 212 new files
Database: 12 new tables, 7 new options
New tables
wp_pterotype_actors
wp_pterotype_actor_likes
wp_pterotype_following
wp_pterotype_object_likes
wp_pterotype_followers
wp_pterotype_shares
wp_pterotype_keys
wp_pterotype_blocks
wp_pterotype_comments
wp_pterotype_inbox
...
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
can_compress_scripts
pterotype_previously_migrated_version
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Pterotype
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,844 ▲8314.41 ▼0.211.63 ▼0.1642.90 ▼0.76
Dashboard /wp-admin2,240 ▲635.66 ▲0.0291.88 ▲2.3041.37 ▼1.86
Posts /wp-admin/edit.php2,148 ▲511.99 ▲0.0142.73 ▲5.8035.48 ▲1.84
Add New Post /wp-admin/post-new.php1,539 ▲1322.99 ▼0.00598.73 ▼81.2055.96 ▲1.45
Media Library /wp-admin/upload.php1,448 ▲484.23 ▲0.11104.42 ▼1.1146.30 ▲3.16

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function register_rest_route was called incorrectly. The REST API route definition for pterotype/v1/actor/(?P[a-zA-Z0-9-_]+)/outbox is missing the required permission_callback argument. For REST API routes that are intended to be public, use __return_true as the permission callback. Please see Debugging in WordPress for more information. (This message was added in version 5.5.0.)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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
Everything seems fine, however this is by no means 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 take a closer look at the following
  • 54× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA' not found in wp-content/plugins/pterotype/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_rsa.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pterotype\\activities\\announce\\plugin_dir_path() in wp-content/plugins/pterotype/includes/server/activities/announce.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pterotype\\deliver\\plugin_dir_path() in wp-content/plugins/pterotype/includes/server/deliver.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pterotype\\outbox\\plugin_dir_path() in wp-content/plugins/pterotype/includes/server/outbox.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pterotype\\comments\\plugin_dir_path() in wp-content/plugins/pterotype/includes/client/comments.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pterotype\\activities\\follow\\plugin_dir_path() in wp-content/plugins/pterotype/includes/server/activities/follow.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\TripleDES' not found in wp-content/plugins/pterotype/vendor/singpolyma/openpgp-php/lib/openpgp_crypt_symmetric.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/pterotype/vendor/phpseclib/phpseclib/phpseclib/Crypt/Twofish.php:48
    • > PHP Fatal error
      Uncaught Error: Call to undefined function pterotype\\schema\\plugin_dir_path() in wp-content/plugins/pterotype/includes/schema.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/pterotype/vendor/phpseclib/phpseclib/phpseclib/Crypt/RC2.php:44

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
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 describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
3 plugin tags: fediverse, federation, activitypub

pterotype/pterotype.php 92% from 13 tests

The main PHP file in "Pterotype" ver. 1.4.3 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Git Repository: An alternative Git repository was detected

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected26,539 lines of code in 101 files:
LanguageFilesBlank linesComment linesLines of code
PHP884,19411,98725,944
JSON500337
Markdown4840184
XML25036
JavaScript15023
YAML12115

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity40.31
▷ Minimum class complexity1.00
▷ Maximum class complexity591.00
Average method complexity4.84
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces44
Interfaces0
Traits0
Classes89
▷ Abstract classes22.25%
▷ Concrete classes8797.75%
▷ Final classes00.00%
Methods917
▷ Static methods374.03%
▷ Public methods90498.58%
▷ Protected methods111.20%
▷ Private methods20.22%
Functions242
▷ Named functions20283.47%
▷ Anonymous functions4016.53%
Constants187
▷ Global constants2915.51%
▷ Class constants15884.49%
▷ Public constants158100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin