99% restposts

Code Review | RESTposts

WordPress plugin RESTposts scored 99% from 54 tests.

About plugin

  • Plugin page: restposts
  • Plugin version: 1.1.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.8.1
  • WordPress version: 5.9.2
  • First release: Feb 7, 2017
  • Latest release: Oct 16, 2021
  • Number of updates: 35
  • Update frequency: every 48.8 days
  • Top authors: mathewemoore (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active / 949 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▼0.02MB] [CPU: ▼335.50ms] Passed 4 tests

This is a short check of server-side resources used by RESTposts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0154.60 ▲5.36
Dashboard /wp-admin3.41 ▲0.0031.55 ▼1.35
Posts /wp-admin/edit.php3.65 ▲0.0044.12 ▲6.80
Add New Post /wp-admin/post-new.php6.89 ▼0.0992.45 ▼1,342.84
Media Library /wp-admin/upload.php3.30 ▲0.0022.84 ▼3.18

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for RESTposts
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲1916.25 ▲0.506.31 ▲0.522.28 ▼0.07
Dashboard /wp-admin2,895 ▲416.13 ▼0.03118.13 ▼16.17156.57 ▲0.70
Posts /wp-admin/edit.php2,694 ▼03.23 ▲0.0065.39 ▲0.15139.53 ▲1.16
Add New Post /wp-admin/post-new.php1,668 ▼9018.20 ▼4.00383.59 ▼77.34160.09 ▲0.88
Media Library /wp-admin/upload.php1,695 ▼35.45 ▼0.09145.57 ▲0.25200.20 ▲10.77

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
Uninstall script ran successfully

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (19 tag instead of maximum 10)
You can take inspiration from this readme.txt

restposts/rest-posts.php 92% from 13 tests

The entry point to "RESTposts" version 1.1.2 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("restposts.php" instead of "rest-posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin1,029 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9200223793
CSS24149196
JavaScript1102040

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity35.50
▷ Minimum class complexity33.00
▷ Maximum class complexity38.00
Average method complexity10.86
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods7
▷ Static methods00.00%
▷ Public methods7100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin