100% new-posts-block

Code Review | New Posts Block

WordPress plugin New Posts Block scored 100% from 54 tests.

About plugin

  • Plugin page: new-posts-block
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 5.8.1
  • First release: May 3, 2019
  • Latest release: Mar 13, 2020
  • Number of updates: 26
  • Update frequency: every 12.1 days
  • Top authors: ishitaka (100%)

Code review

54 tests

User reviews

1 review

Install metrics

400+ active / 2,176 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼149.28ms] Passed 4 tests

An overview of server-side resources used by New Posts Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.0134.93 ▼1.01
Dashboard /wp-admin3.06 ▲0.0144.26 ▼4.93
Posts /wp-admin/edit.php3.12 ▲0.0157.57 ▲9.62
Add New Post /wp-admin/post-new.php5.42 ▼0.0184.75 ▼588.50
Media Library /wp-admin/upload.php3.01 ▲0.0131.59 ▼2.68

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

This is an overview of browser requirements for New Posts Block
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,714 ▲11815.86 ▲0.2410.61 ▲0.4646.01 ▼4.25
Dashboard /wp-admin2,967 ▲365.92 ▼0.05150.91 ▼2.56138.93 ▲20.86
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0174.61 ▲6.3199.99 ▲5.09
Add New Post /wp-admin/post-new.php1,879 ▲38119.23 ▲0.34362.87 ▼16.50116.02 ▲3.25
Media Library /wp-admin/upload.php1,807 ▼05.02 ▼0.01142.99 ▼7.22117.02 ▼8.79

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

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
5 plugin tags: latest posts, feed, block, rss, gutenberg

new-posts-block/plugin.php 92% from 13 tests

The main PHP file in "New Posts Block" ver. 1.2.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("new-posts-block.php" instead of "plugin.php")

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 plugin768 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JSX7320354
PHP23821244
Sass410098
PO File1262665
CSS1404
JavaScript10102
JSON1001

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity23.00
Average method complexity3.44
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods9
▷ Static methods111.11%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
PNG images were not found in this plugin