84% ns-featured-posts

Code Review | NS Featured Posts

WordPress plugin NS Featured Posts scored84%from 54 tests.

About plugin

  • Plugin page: ns-featured-posts
  • Plugin version: 2.0.10
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.2
  • WordPress version: 6.3.1
  • First release: Jun 4, 2014
  • Latest release: May 23, 2023
  • Number of updates: 56
  • Update frequency: every 58.5 days
  • Top authors: rabmalin (100%)

Code review

54 tests

User reviews

18 reviews

Install metrics

6,000+ active /87,010 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▲0.84ms] Passed 4 tests

This is a short check of server-side resources used by NS Featured Posts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0644.04 ▲0.53
Dashboard /wp-admin3.48 ▲0.1852.92 ▼1.55
Posts /wp-admin/edit.php3.53 ▲0.1853.96 ▲3.29
Add New Post /wp-admin/post-new.php6.00 ▲0.1199.61 ▲2.80
Media Library /wp-admin/upload.php3.32 ▲0.0939.00 ▲1.57
NS Featured Posts /wp-admin/options-general.php?page=ns-featured-posts3.3139.06

Server storage [IO: ▲0.24MB] [DB: ▲0.02MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 9 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_nsfp-featured-post-widget
nsfp_option_migration_complete
db_upgraded
widget_recent-posts
widget_theysaidso_widget
nsfp_plugin_options
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS Featured Posts
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,993 ▲23217.28 ▲3.052.00 ▲0.2543.29 ▼0.41
Dashboard /wp-admin2,400 ▲1968.19 ▲3.31170.18 ▲61.4642.19 ▼0.65
Posts /wp-admin/edit.php2,343 ▲2405.33 ▲3.3292.84 ▲51.8234.13 ▼5.46
Add New Post /wp-admin/post-new.php1,723 ▲18717.47 ▼5.79607.04 ▲2.3135.11 ▼13.69
Media Library /wp-admin/upload.php1,438 ▲355.55 ▲1.38130.20 ▲24.0345.98 ▼1.15
NS Featured Posts /wp-admin/options-general.php?page=ns-featured-posts1,2055.2791.8029.78

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_nsfp-featured-post-widget
    • nsfp_option_migration_complete
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • nsfp_plugin_options
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ns-featured-posts/includes/widgets/nsfp-featured-post-widget.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Nilambar\\Optioner\\add_action() in wp-content/plugins/ns-featured-posts/vendor/ernilambar/optioner/optioner.php:32

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 Passed 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
10 plugin tags: posts, custom post type, meta, featured, post...

ns-featured-posts/ns-featured-posts.php Passed 13 tests

The main PHP script in "NS Featured Posts" version 2.0.10 is automatically included on every request by WordPress
63 characters long description:
Plugin to make your posts, pages and custom post types Featured

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,876 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP208151,5502,603
JSON300149
JavaScript317099
CSS24023
Markdown1102

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity39.18
▷ Minimum class complexity1.00
▷ Maximum class complexity152.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods163
▷ Static methods2817.18%
▷ Public methods13482.21%
▷ Protected methods116.75%
▷ Private methods1811.04%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants11
▷ Global constants872.73%
▷ Class constants327.27%
▷ 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
No PNG files were detected