10% cooksnaps

Code Review | Cooksnaps

WordPress plugin Cooksnaps scored 10% from 53 tests.

About plugin

  • Plugin page: cooksnaps
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 5.8.1
  • First release: Dec 24, 2013
  • Latest release: Dec 21, 2014
  • Number of updates: 28
  • Update frequency: every 12.9 days
  • Top authors: jgranado (71.43%)milesw (32.14%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 1,387 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/cooksnaps/cooksnaps.php+144
    Methods with the same name as their class will not be constructors in a future version of PHP; Cooksnaps_Widget has a deprecated constructor

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

An overview of server-side resources used by Cooksnaps
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.80 ▼1.045.43 ▼22.92
Dashboard /wp-admin1.81 ▼1.246.58 ▼37.37
Posts /wp-admin/edit.php1.82 ▼1.295.13 ▼36.46
Add New Post /wp-admin/post-new.php1.81 ▼3.614.71 ▼1,125.77
Media Library /wp-admin/upload.php1.81 ▼1.195.21 ▼33.48

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 22 new files
Database: no new tables, 4 new options
New WordPress options
cooksnaps_locale
widget_cooksnaps_wpwidget
cooksnaps_key
widget_cooksnaps_gallery_wpwidget

Browser metrics Passed 4 tests

A check of browser resources used by Cooksnaps
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,855 ▲27316.73 ▲0.7719.99 ▲11.4644.43 ▼4.87
Dashboard /wp-admin2,937 ▲845.94 ▲0.06133.46 ▲2.09127.27 ▲23.55
Posts /wp-admin/edit.php2,732 ▲262.69 ▼0.0062.20 ▼3.0487.51 ▼2.79
Add New Post /wp-admin/post-new.php1,870 ▲1719.19 ▼0.01360.34 ▼30.16104.26 ▲0.98
Media Library /wp-admin/upload.php1,730 ▼425.02 ▲0.02127.02 ▼35.56116.14 ▲0.11

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/cooksnaps/cooksnaps.php+144
    Methods with the same name as their class will not be constructors in a future version of PHP; Cooksnaps_Widget has a deprecated constructor
  • Zombie WordPress options detected upon uninstall: 2 options
    • widget_cooksnaps_wpwidget
    • widget_cooksnaps_gallery_wpwidget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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 items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/cooksnaps/admin/cooksnaps-post-column.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/cooksnaps/admin/cooksnaps_settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cooksnaps/cooksnaps.php:128
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/cooksnaps/cooksnapbox.php:1

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 93% 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
Attributes that need to be fixed:
  • Screenshots: These screenshots require images: #1 (Cooksnaps Full widget), #2 (Alternate Cooksnaps Mini Button), #3 (Once installed, click on 'Cooksnap' to finish the setup), #4 (Recipe Analytics), #5 (Optionally put Cooksnaps in your sidebar using the Wordpress Widgets menu), #6 (Add the Cooksnaps Gallery Widget to your sidebar to show all your latest Cooksnaps on your site)
The official readme.txt might help

cooksnaps/cooksnaps.php 92% from 13 tests

The entry point to "Cooksnaps" version 2.0 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 154 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin333 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP43635223
PO File32434110

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity2.00
▷ Minimum class complexity2.00
▷ Maximum class complexity2.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/cooksnaps-16.png3.58KB1.08KB▼ 69.76%
img/cooksnaps_grey_18.png0.55KB0.66KB0.00%
img/cooksnaps-32.png5.50KB1.74KB▼ 68.33%
img/cooksnaps_16_bw.png0.55KB0.93KB0.00%