78% wp-calorie-calculator

Code Review | WP Calorie Calculator

WordPress plugin WP Calorie Calculator scored78%from 54 tests.

About plugin

  • Plugin page: wp-calorie-calcul...
  • Plugin version: 4.0.12
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3
  • WordPress version: 6.3.1
  • First release: Dec 23, 2020
  • Latest release: Oct 4, 2023
  • Number of updates: 58
  • Update frequency: every 17.5 days
  • Top authors: belovdigital (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /21,060 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼1.83ms] Passed 4 tests

A check of server-side resources used by WP Calorie Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1540.04 ▲2.74
Dashboard /wp-admin3.46 ▲0.1153.09 ▼11.41
Posts /wp-admin/edit.php3.57 ▲0.2251.00 ▲1.99
Add New Post /wp-admin/post-new.php6.04 ▲0.1585.71 ▼0.64
Media Library /wp-admin/upload.php3.38 ▲0.1538.55 ▲5.64
Calorie Calculator /wp-admin/admin.php?page=wp-calorie-calculator3.7040.52

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 49 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
wpcc_pro_version_advertisement
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for WP Calorie Calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,892 ▲14613.25 ▼1.441.90 ▲0.1919.92 ▼18.62
Dashboard /wp-admin2,238 ▲474.84 ▼1.04111.56 ▼4.0942.94 ▼3.41
Posts /wp-admin/edit.php2,145 ▲531.92 ▼0.1140.77 ▼1.04106.16 ▲66.61
Add New Post /wp-admin/post-new.php1,558 ▲4423.35 ▲5.83684.21 ▲44.0765.83 ▲12.29
Media Library /wp-admin/upload.php1,418 ▲274.19 ▼0.0399.87 ▲4.1844.30 ▲2.75
Calorie Calculator /wp-admin/admin.php?page=wp-calorie-calculator5,5353.24128.5248.98
Go Pro /wp-admin/admin.php?page=#wpcc-go-pro280.440.063.86

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • wpcc_pro_version_advertisement
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 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 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 fix the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Calorie_Calculator' not found in wp-content/plugins/wp-calorie-calculator/public/partials/wp-calorie-calculator-public-display.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Calorie_Calculator' not found in wp-content/plugins/wp-calorie-calculator/admin/partials/wp-calorie-calculator-admin-display.php:14

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=#wpcc-go-pro
    • > Network (severe)
    wp-admin/admin.php?page=#wpcc-go-pro - Failed to load resource: the server responded with a status of 403 (Forbidden)

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
9 plugin tags: health, gym, macros, fitness, nutrition...

wp-calorie-calculator/wp-calorie-calculator.php 92% from 13 tests

The entry point to "WP Calorie Calculator" version 4.0.12 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 177 characters long)

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
Everything looks great! No dangerous files found in this plugin3,600 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code
PHP112605411,801
PO File37301,1691,680
SVG1400115
CSS2002
JavaScript2002

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity7.83
▷ Minimum class complexity1.00
▷ Maximum class complexity28.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity28.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods39
▷ Static methods12.56%
▷ Public methods3487.18%
▷ Protected methods00.00%
▷ Private methods512.82%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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 compressed PNG file occupies 0.02MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/banner-sport.png15.95KB17.22KB0.00%