72% simple-recipe

Code Review | Simple Recipe

WordPress plugin Simple Recipe scored72%from 54 tests.

About plugin

  • Plugin page: simple-recipe
  • Plugin version: 1...
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.4
  • WordPress version: 6.3.1
  • First release: Apr 21, 2020
  • Latest release: May 17, 2020
  • Number of updates: 5
  • Update frequency: every 5.4 days
  • Top authors: guruteam (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /515 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

Server metrics [RAM: ▲1.50MB] [CPU: ▲6.55ms] Passed 4 tests

Server-side resources used by Simple Recipe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.95 ▲1.4946.85 ▲5.16
Dashboard /wp-admin4.81 ▲1.5163.45 ▲8.00
Posts /wp-admin/edit.php4.94 ▲1.5860.37 ▲14.96
Add New Post /wp-admin/post-new.php7.40 ▲1.51101.07 ▲3.33
Media Library /wp-admin/upload.php4.72 ▲1.5046.04 ▲9.70
Ingredients /wp-admin/edit-tags.php?taxonomy=smrc_ingredients&post_type=simple-recipe4.7545.85
Recipes Categories /wp-admin/edit-tags.php?taxonomy=smrc_recipe_category&post_type=simple-recipe4.7546.29
Add New /wp-admin/post-new.php?post_type=simple-recipe4.9461.92
Recipes /wp-admin/edit.php?post_type=simple-recipe4.7951.98

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Simple Recipe
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,207 ▲42116.54 ▲2.196.21 ▲4.2537.91 ▼6.73
Dashboard /wp-admin2,465 ▲2857.69 ▲2.07141.17 ▲42.54109.82 ▲63.96
Posts /wp-admin/edit.php2,417 ▲3354.56 ▲2.5575.84 ▲40.1780.89 ▲48.59
Add New Post /wp-admin/post-new.php1,682 ▲15619.63 ▼3.24674.36 ▼12.6635.91 ▼20.05
Media Library /wp-admin/upload.php1,607 ▲2105.75 ▲1.32114.65 ▲14.45112.76 ▲69.28
Ingredients /wp-admin/edit-tags.php?taxonomy=smrc_ingredients&post_type=simple-recipe1,5604.4267.0784.20
Recipes Categories /wp-admin/edit-tags.php?taxonomy=smrc_recipe_category&post_type=simple-recipe1,5634.2564.7562.35
Add New /wp-admin/post-new.php?post_type=simple-recipe3,1069.70210.24221.66
Recipes /wp-admin/edit.php?post_type=simple-recipe1,4204.4475.9787.03

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_smrc_filter

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 12× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/components/drip_content.php
    • > /wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/components/payments.php
    • > /wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/order.php
    • > /wp-content/plugins/simple-recipe/smrc_templates/add_recipe/parts/image.php
    • > /wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/not_exist.php
    • > /wp-content/plugins/simple-recipe/smrc_templates/add_recipe/parts/title.php
    • > /wp-content/plugins/simple-recipe/smrc_templates/add_recipe/parts/level.php
    • > /wp-content/plugins/simple-recipe/smrc_templates/archive/grid/image.php
    • > /wp-content/plugins/simple-recipe/smrc_templates/add_recipe/parts/ingredients.php
    • > /wp-content/plugins/simple-recipe/smrc_templates/add_recipe/parts/data.php
  • 212× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant STM_WPCFTO_PATH - assumed 'STM_WPCFTO_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/drip_content.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'SMRC_Enqueue' not found in wp-content/plugins/simple-recipe/smrc_templates/single/related.php:2
    • > PHP Fatal error
      require_once(): Failed opening required 'STM_WPCFTO_PATH/helpers/icons.php' (include_path='.:/usr/share/php') in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/taxonomy_meta/fields/icon.php on line 3
    • > PHP Notice
      Undefined variable: section_name in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/addons.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/components_js/payments.php:15
    • > PHP Notice
      Undefined variable: section_name in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/checkbox.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/simple-recipe/smrc_templates/archive/main.php:7
    • > PHP Warning
      include(): Failed opening 'STM_WPCFTO_PATH/metaboxes/components_js/curriculum.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/post_type_repeat.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/components/questions.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/fields/udemy/search.php:15

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/edit-tags.php?taxonomy=smrc_ingredients&post_type=simple-recipe
    • > Network (severe)
    wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/assets/js/sortable.min.js?ver=1697866942 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit-tags.php?taxonomy=smrc_recipe_category&post_type=simple-recipe
    • > Network (severe)
    wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/assets/js/sortable.min.js?ver=1697866944 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=simple-recipe
    • > Network (severe)
    wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/assets/js/sortable.min.js?ver=1697866946 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/edit.php?post_type=simple-recipe
    • > Network (severe)
    wp-content/plugins/simple-recipe/wp-custom-fields-theme-options/metaboxes/assets/js/sortable.min.js?ver=1697866948 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: recipe plugin, cooking, recipes, food blog

simple-recipe/simple_recipe.php 77% from 13 tests

The main PHP script in "Simple Recipe" version 1... is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-recipe.php" instead of "simple_recipe.php")
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Version: The version number should be digits and periods (ex. "1.0.3" instead of "1...")

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
Everything looks great! No dangerous files found in this plugin89,678 lines of code in 266 files:
LanguageFilesBlank linesComment linesLines of code
JSON40053,213
CSS191,4943112,474
SVG1101610,908
PHP1491,5011,1267,631
Sass38262103,324
JavaScript43264772,012
Markdown2330116

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity28.74
▷ Minimum class complexity1.00
▷ Maximum class complexity203.00
Average method complexity3.41
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods211
▷ Static methods6028.44%
▷ Public methods15673.93%
▷ Protected methods5325.12%
▷ Private methods20.95%
Functions38
▷ Named functions2976.32%
▷ Anonymous functions923.68%
Constants7
▷ Global constants685.71%
▷ Class constants114.29%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected