73% cd-nutritional

Code Review | CD Nutritional Facts

WordPress plugin CD Nutritional Facts scored73%from 54 tests.

About plugin

  • Plugin page: cd-nutritional
  • Plugin version: 0.3 Lite...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 15, 2019
  • Latest release: Jul 8, 2020
  • Number of updates: 13
  • Update frequency: every 25.3 days
  • Top authors: channeldigitaluk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /894 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.90MB] [CPU: ▼56.48ms] Passed 4 tests

An overview of server-side resources used by CD Nutritional Facts
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.384.99 ▼39.83
Dashboard /wp-admin2.10 ▼1.206.16 ▼40.93
Posts /wp-admin/edit.php2.10 ▼1.256.24 ▼46.91
Add New Post /wp-admin/post-new.php2.10 ▼3.786.27 ▼98.26
Media Library /wp-admin/upload.php2.10 ▼1.127.69 ▼24.70

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for CD Nutritional Facts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,806 ▲7113.23 ▼1.412.12 ▼0.2043.20 ▼0.62
Dashboard /wp-admin2,205 ▲175.76 ▲0.8596.98 ▼5.6538.27 ▼6.11
Posts /wp-admin/edit.php2,091 ▼12.05 ▲0.0436.97 ▼10.4332.21 ▼4.01
Add New Post /wp-admin/post-new.php1,539 ▼318.59 ▲0.45643.59 ▲31.3763.58 ▲11.56
Media Library /wp-admin/upload.php1,393 ▲24.21 ▼0.0495.12 ▼1.2543.58 ▼2.80

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the styles handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 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
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cd-nutritional/CD-Nutritional-Plugin.php:14

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 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Donate link: Invalid URI ("")
The official readme.txt might help

cd-nutritional/CD-Nutritional-Plugin.php 85% from 13 tests

"CD Nutritional Facts" version 0.3 Lite...'s main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "0.3 Lite...")
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("cd-nutritional.php" instead of "CD-Nutritional-Plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin301 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP11612149
XML500100
CSS11232
SVG10020

PHP code Passed 2 tests

This is a very shot review 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.30
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin