10% nuno-sarmento-custom-css-js

Code Review | Nuno Sarmento Custom CSS - JS

WordPress plugin Nuno Sarmento Custom CSS - JS scored10%from 54 tests.

About plugin

  • Plugin page: nuno-sarmento-cus...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Jan 31, 2017
  • Latest release: Nov 27, 2020
  • Number of updates: 38
  • Update frequency: every 36.6 days
  • Top authors: nunosarmento (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,389 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-content/plugins/nuno-sarmento-custom-css-js/nuno-sarmento-custom-css-js.php+62
    include(nuno-sarmento-custom-css-js-services.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼1.96MB] [CPU: ▼49.45ms] Passed 4 tests

Analyzing server-side resources used by Nuno Sarmento Custom CSS - JS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.28 ▼38.58
Dashboard /wp-admin2.05 ▼1.266.09 ▼42.02
Posts /wp-admin/edit.php2.05 ▼1.315.75 ▼38.31
Add New Post /wp-admin/post-new.php2.05 ▼3.846.69 ▼78.87
Media Library /wp-admin/upload.php2.05 ▼1.185.87 ▼27.91
Custom CSS & JS /wp-admin/themes.php?page=tend-custom-css-js2.056.17

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 16 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Nuno Sarmento Custom CSS - JS
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.13 ▼1.282.00 ▲0.1142.23 ▼4.07
Dashboard /wp-admin2,209 ▲215.84 ▲0.96100.71 ▼17.0741.92 ▼2.69
Posts /wp-admin/edit.php2,095 ▲92.03 ▲0.0338.80 ▲2.7938.44 ▲3.25
Add New Post /wp-admin/post-new.php6,374 ▲4,83722.02 ▼1.45898.86 ▲235.9874.63 ▲21.35
Media Library /wp-admin/upload.php1,394 ▲64.26 ▼0.0396.91 ▼4.9640.92 ▼4.23
Custom CSS & JS /wp-admin/themes.php?page=tend-custom-css-js8002.0222.3826.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/nuno-sarmento-custom-css-js/nuno-sarmento-custom-css-js.php+62
    include(nuno-sarmento-custom-css-js-services.php): failed to open stream: No such file or directory
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/themes.php?page=tend-custom-css-js
    • > Warning in wp-content/plugins/nuno-sarmento-custom-css-js/nuno-sarmento-custom-css-js.php+62
    include(nuno-sarmento-custom-css-js-services.php): failed to open stream: No such file or directory
    • > GET request to /wp-admin/themes.php?page=tend-custom-css-js
    • > Warning in wp-content/plugins/nuno-sarmento-custom-css-js/nuno-sarmento-custom-css-js.php+62
    include(): Failed opening 'nuno-sarmento-custom-css-js-services.php' for inclusion (include_path='.:/usr/share/php')

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
Almost there! Just fix the following items
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/nuno-sarmento-custom-css-js/nuno-sarmento-custom-css-js.php

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
7 plugin tags: custom, pages, posts, admin, javascript...

nuno-sarmento-custom-css-js/nuno-sarmento-custom-css-js.php 92% from 13 tests

This is the main PHP file of "Nuno Sarmento Custom CSS - JS" version 1.0.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 plugin222 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34745173
PO File16634
CSS11015

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity30.00
▷ Minimum class complexity30.00
▷ Maximum class complexity30.00
Average method complexity3.23
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
6 PNG files occupy 0.50MB with 0.36MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/screenshot-1.png234.77KB67.19KB▼ 71.38%
assets/images/icon-128x128.png11.94KB3.78KB▼ 68.34%
assets/images/banner-772x250.png28.29KB6.73KB▼ 76.21%
assets/images/icon-256x256.png21.32KB6.69KB▼ 68.63%
assets/images/screenshot-2.png140.42KB38.90KB▼ 72.30%