84% nicebackgrounds

Code Review | Nice Backgrounds

WordPress plugin Nice Backgrounds scored84%from 54 tests.

About plugin

  • Plugin page: nicebackgrounds
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.5
  • WordPress version: 6.3.1
  • First release: Mar 1, 2016
  • Latest release: Mar 31, 2016
  • Number of updates: 6
  • Update frequency: every 5.2 days
  • Top authors: brx8r (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /2,814 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼5.81ms] Passed 4 tests

Analyzing server-side resources used by Nice Backgrounds
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0446.32 ▲1.16
Dashboard /wp-admin3.41 ▲0.1152.29 ▼3.29
Posts /wp-admin/edit.php3.46 ▲0.1152.36 ▼2.72
Add New Post /wp-admin/post-new.php5.99 ▲0.1090.98 ▼18.38
Media Library /wp-admin/upload.php3.33 ▲0.1042.82 ▲4.05
Nice Backgrounds /wp-admin/themes.php?page=nicebackgrounds3.6752.01

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 44 new files
Database: no new tables, 13 new options
New WordPress options
widget_recent-posts
nicebackgrounds_sizes
db_upgraded
nicebackgrounds_unsplash_categories
nicebackgrounds_images
nicebackgrounds_unsplash_keywords
widget_recent-comments
nicebackgrounds_unsplash_users
widget_theysaidso_widget
nicebackgrounds_reserves
...

Browser metrics Passed 4 tests

A check of browser resources used by Nice Backgrounds
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.76 ▲0.171.85 ▼0.0940.79 ▼1.96
Dashboard /wp-admin2,199 ▲255.59 ▲0.0190.70 ▼3.9441.39 ▲1.16
Posts /wp-admin/edit.php2,104 ▲11.98 ▲0.0137.44 ▼3.4535.44 ▼1.12
Add New Post /wp-admin/post-new.php1,531 ▲523.02 ▼0.67699.05 ▲32.7859.16 ▼2.23
Media Library /wp-admin/upload.php1,407 ▲74.25 ▼0.0395.30 ▼14.2941.33 ▼4.80
Nice Backgrounds /wp-admin/themes.php?page=nicebackgrounds1,4582.4252.3256.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 13 options in the database
    • nicebackgrounds_unsplash_keywords
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • nicebackgrounds_unsplash_categories
    • nicebackgrounds_sets
    • can_compress_scripts
    • db_upgraded
    • nicebackgrounds_unsplash_users
    • nicebackgrounds_sizes
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nicebackgrounds/nicebackgrounds.php:204

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
Please take inspiration from this readme.txt

nicebackgrounds/nicebackgrounds.php Passed 13 tests

The entry point to "Nice Backgrounds" version 1.0 is a PHP file that has certain tags in its header comment area
81 characters long description:
Manage random adaptive background images and pull beautiful photos from Unsplash.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected4,524 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP93879671,905
JavaScript111491391,089
CSS41386775
LESS1517550734
JSON10021

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
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%
Functions120
▷ Named functions120100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
No PNG images were found in this plugin