84% ninja-page-categories-and-tags

Code Review | Ninja Pages

WordPress plugin Ninja Pages scored 84% from 54 tests.

About plugin

  • Plugin page: ninja-page-catego...
  • Plugin version: 1.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.6
  • WordPress version: 6.3.1
  • First release: Aug 6, 2010
  • Latest release: Jul 28, 2016
  • Number of updates: 53
  • Update frequency: every 41.2 days
  • Top authors: jameslaws (92.45%)kstover (9.43%)

Code review

54 tests

User reviews

12 reviews

Install metrics

4,000+ active / 52,023 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼5.68ms] Passed 4 tests

This is a short check of server-side resources used by Ninja Pages
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0344.48 ▼6.71
Dashboard /wp-admin3.36 ▲0.0649.30 ▼1.04
Posts /wp-admin/edit.php3.47 ▲0.1248.34 ▲0.14
Add New Post /wp-admin/post-new.php5.94 ▲0.0587.81 ▼15.12
Media Library /wp-admin/upload.php3.28 ▲0.0537.25 ▲3.24
Ninja Pages /wp-admin/options-general.php?page=ninja-pages3.2533.21

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Ninja Pages
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5814.44 ▲0.061.82 ▼0.5838.08 ▼5.45
Dashboard /wp-admin2,207 ▲195.81 ▼0.08103.01 ▼13.4242.13 ▼1.49
Posts /wp-admin/edit.php2,093 ▲42.06 ▲0.0138.75 ▼0.0235.81 ▲0.46
Add New Post /wp-admin/post-new.php1,517 ▼1617.63 ▼5.46685.44 ▲69.4254.15 ▲5.42
Media Library /wp-admin/upload.php1,395 ▲104.17 ▼0.0598.80 ▼3.7343.38 ▼0.08
Ninja Pages /wp-admin/options-general.php?page=ninja-pages9112.2126.9327.38

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 5× 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/ninja-page-categories-and-tags/shortcodes.php:73
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_setting() in wp-content/plugins/ninja-page-categories-and-tags/basic-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ninja-page-categories-and-tags/basic-functions.php:34
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/ninja-page-categories-and-tags/ninja-pages.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ninja-page-categories-and-tags/ninja-pages.php:15

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: pages, tags, tag, page, category...

ninja-page-categories-and-tags/ninja-pages.php 92% from 13 tests

The main PHP file in "Ninja Pages" ver. 1.4.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ninja-page-categories-and-tags.php" instead of "ninja-pages.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
No dangerous file extensions were detected853 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46544409
CSS1121397
PO File1161847

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/nf-banner-300x250.png13.11KB5.87KB▼ 55.24%
images/nf-banner-240x400.png21.70KB9.79KB▼ 54.90%
images/wpnj-logo-wt.png10.68KB4.48KB▼ 58.05%