89% profile-widget-ninja

Code Review | Profile Widget Ninja

WordPress plugin Profile Widget Ninja scored89%from 54 tests.

About plugin

  • Plugin page: profile-widget-ninja
  • Plugin version: 4.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.8
  • WordPress version: 6.3.1
  • First release: Jan 16, 2016
  • Latest release: Mar 18, 2022
  • Number of updates: 90
  • Update frequency: every 25.0 days
  • Top authors: gurudeb (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

900+ active /30,456 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.20MB] [CPU: ▼2.09ms] Passed 4 tests

Analyzing server-side resources used by Profile Widget Ninja
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2041.39 ▼1.17
Dashboard /wp-admin3.51 ▲0.2049.07 ▼3.10
Posts /wp-admin/edit.php3.56 ▲0.1950.87 ▲4.54
Add New Post /wp-admin/post-new.php6.10 ▲0.2185.72 ▼8.63
Media Library /wp-admin/upload.php3.43 ▲0.1936.09 ▲5.12

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 13 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_profile_widget_ninja
widget_theysaidso_widget
can_compress_scripts
db_upgraded
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Profile Widget Ninja
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲8613.44 ▼1.231.89 ▲0.0443.05 ▼1.11
Dashboard /wp-admin2,225 ▲375.08 ▼0.74111.45 ▼5.0239.53 ▼8.81
Posts /wp-admin/edit.php2,113 ▲242.29 ▲0.2841.25 ▲2.6034.14 ▼0.49
Add New Post /wp-admin/post-new.php1,696 ▲16224.74 ▲1.38576.60 ▼113.6633.94 ▼24.79
Media Library /wp-admin/upload.php1,407 ▲164.42 ▲0.2496.30 ▼9.0941.46 ▼3.31

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_profile_widget_ninja
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
Looking good! No server-side errors or output 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
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 23 tag instead of maximum 10
You can look at the official readme.txt

profile-widget-ninja/profile_widget_ninja.php 92% from 13 tests

The entry point to "Profile Widget Ninja" version 4.3 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("profile-widget-ninja.php" instead of "profile_widget_ninja.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected903 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP269103619
CSS1817277
JavaScript1027

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 102)
Cyclomatic complexity
Average complexity per logical line of code0.72
Average class complexity258.00
▷ Minimum class complexity258.00
▷ Maximum class complexity258.00
Average method complexity33.12
▷ Minimum method complexity1.00
▷ Maximum method complexity102.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
icons/sprite.png28.60KB9.47KB▼ 66.89%
icons/paypal.png1.29KB1.29KB0.15%
icons/star.png0.65KB0.66KB0.00%
icons/donate.png2.40KB1.67KB▼ 30.48%