88% recent-posts-by-nn

Code Review | NN Recent Posts

WordPress plugin NN Recent Posts scored 88% from 54 tests.

About plugin

  • Plugin page: recent-posts-by-nn
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.8-4.9.6
  • WordPress version: 5.8.1
  • First release: Jun 14, 2018
  • Latest release: Jun 15, 2018
  • Number of updates: 6
  • Update frequency: every 1.0 days
  • Top authors: amirkeshavarzreza (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 390 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.07MB] [CPU: ▼171.25ms] Passed 4 tests

A check of server-side resources used by NN Recent Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.90 ▲0.1836.50 ▲15.58
Dashboard /wp-admin3.12 ▲0.0643.51 ▼3.12
Posts /wp-admin/edit.php3.23 ▲0.1245.19 ▼5.18
Add New Post /wp-admin/post-new.php5.48 ▲0.0488.74 ▼676.26
Media Library /wp-admin/upload.php3.06 ▲0.0634.22 ▼0.43

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 25 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for NN Recent Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,794 ▲19816.25 ▲0.6413.70 ▲3.8950.95 ▼1.29
Dashboard /wp-admin2,977 ▲465.87 ▼0.07145.70 ▼3.77112.36 ▼15.23
Posts /wp-admin/edit.php2,743 ▲42.71 ▼0.0161.45 ▼5.0184.81 ▼10.17
Add New Post /wp-admin/post-new.php1,676 ▼718.78 ▲0.04379.71 ▼1.79111.01 ▲3.67
Media Library /wp-admin/upload.php1,811 ▲45.02 ▲0.01153.77 ▼19.14123.48 ▼2.07

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 2× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/recent-posts-by-nn/public/partials/nn_recent_posts-public-display.php
    • > /wp-content/plugins/recent-posts-by-nn/admin/partials/nn_recent_posts-admin-display.php
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/recent-posts-by-nn/inc/shortcodes.php:76

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from) image not found
You can look at the official readme.txt

recent-posts-by-nn/nn_recent_posts.php 85% from 13 tests

The primary PHP file in "NN Recent Posts" version 1.0.0 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Main file name: The principal plugin file should be the same as the plugin slug ("recent-posts-by-nn.php" instead of "nn_recent_posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Everything looks great! No dangerous files found in this plugin273 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
PHP14146543242
CSS331125
JavaScript24486

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity1.38
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.12
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2080.00%
▷ Protected methods00.00%
▷ Private methods520.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin