10% info-nutricional

Code Review | Info Nutricional

WordPress plugin Info Nutricional scored10%from 54 tests.

About plugin

  • Plugin page: info-nutricional
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.7.2
  • WordPress version: 6.3.1
  • First release: Dec 15, 2016
  • Latest release: Feb 21, 2017
  • Number of updates: 16
  • Update frequency: every 3.8 days
  • Top authors: granludo (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /3,411 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/info-nutricional/info_nutricional_setup.php+26
    Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP)

Server metrics [RAM: ▼1.89MB] [CPU: ▼57.51ms] Passed 4 tests

Server-side resources used by Info Nutricional
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.13 ▼38.95
Dashboard /wp-admin2.11 ▼1.1912.84 ▼40.84
Posts /wp-admin/edit.php2.11 ▼1.246.61 ▼47.06
Add New Post /wp-admin/post-new.php2.11 ▼3.777.24 ▼103.20
Media Library /wp-admin/upload.php2.11 ▼1.127.67 ▼32.47
Add New /wp-admin/post-new.php?post_type=info_nutricional2.116.47
All Recipes /wp-admin/edit.php?post_type=info_nutricional2.117.15

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
can_compress_scripts
widget_recent-posts
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Info Nutricional: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,837 ▲7614.39 ▼0.171.87 ▼0.2248.23 ▼1.30
Dashboard /wp-admin2,234 ▲605.56 ▼0.0183.37 ▼10.1479.65 ▲31.24
Posts /wp-admin/edit.php2,145 ▲452.00 ▼0.0237.29 ▼3.1233.21 ▼3.19
Add New Post /wp-admin/post-new.php1,579 ▲5323.30 ▼0.44677.15 ▼23.7061.39 ▲9.44
Media Library /wp-admin/upload.php1,439 ▲424.16 ▲0.04112.84 ▲3.4775.18 ▲27.87
Add New /wp-admin/post-new.php?post_type=info_nutricional1,7143.6266.2889.12
All Recipes /wp-admin/edit.php?post_type=info_nutricional1,1091.9631.1029.46

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-content/plugins/info-nutricional/info_nutricional_setup.php+26
    Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP)
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=info_nutricional
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/info-nutricional/info_nutricional_setup.php+26
    Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=info_nutricional
    • > Notice in wp-content/plugins/info-nutricional/infonutricional_settings.php+35
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/post-new.php?post_type=info_nutricional
    • > Notice in wp-content/plugins/info-nutricional/info_nutricional.php+123
    Undefined variable: aliments

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/info-nutricional/info_nutricional_setup.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/info-nutricional/info_nutricional.php:128
    • > PHP Warning
      Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/info-nutricional/info_nutricional_setup.php on line 26
    • > PHP Warning
      Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/info-nutricional/info_nutricional_setup.php on line 26
    • > PHP Warning
      Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/info-nutricional/info_nutricional_setup.php on line 26
    • > PHP Warning
      Use of undefined constant LD_WS_BASE - assumed 'LD_WS_BASE' (this will throw an Error in a future version of PHP) in wp-content/plugins/info-nutricional/info_nutricional_setup.php on line 26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 86% 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
Please fix the following attributes: The official readme.txt is a good inspiration

info-nutricional/info_nutricional.php 77% from 13 tests

The main PHP file in "Info Nutricional" ver. 1.2.3 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("info-nutricional.php" instead of "info_nutricional.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: Please keep the plugin description shorter than 140 characters (currently 435 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected456 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP6165116456

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity1.00
▷ Minimum class complexity1.00
▷ Maximum class complexity1.00
Average method complexity1.00
▷ Minimum method complexity1.00
▷ Maximum method complexity1.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods3
▷ Static methods00.00%
▷ Public methods3100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
info_nutricional_plugin_icon.png13.79KB6.94KB▼ 49.69%