68% lunchtime-inlinecode

Code Review | Lunchtime InlineCode

WordPress plugin Lunchtime InlineCode scored68%from 54 tests.

About plugin

  • Plugin page: lunchtime-inlinecode
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Oct 14, 2016
  • Latest release: Oct 17, 2016
  • Number of updates: 17
  • Update frequency: every 0.2 days
  • Top authors: akrwp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /604 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.87MB] [CPU: ▼49.99ms] Passed 4 tests

A check of server-side resources used by Lunchtime InlineCode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.375.66 ▼41.27
Dashboard /wp-admin2.15 ▼1.158.98 ▼37.11
Posts /wp-admin/edit.php2.15 ▼1.2010.82 ▼35.35
Add New Post /wp-admin/post-new.php2.15 ▼3.748.74 ▼86.22
Media Library /wp-admin/upload.php2.15 ▼1.078.23 ▼24.32
Menupublisher InlineCode /wp-admin/options-general.php?page=lunchtime_inlinecode_options2.167.86

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 13 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Lunchtime InlineCode
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,916 ▲15914.07 ▼0.495.11 ▲3.0240.68 ▼4.66
Dashboard /wp-admin2,208 ▲205.84 ▲0.04107.00 ▼12.6237.69 ▼9.44
Posts /wp-admin/edit.php2,097 ▲52.00 ▼0.0036.67 ▼0.8234.04 ▲2.52
Add New Post /wp-admin/post-new.php1,521 ▼2123.27 ▼0.03661.51 ▲12.2157.17 ▲4.99
Media Library /wp-admin/upload.php1,396 ▲84.24 ▲0.0694.28 ▼6.2740.39 ▼3.90
Menupublisher InlineCode /wp-admin/options-general.php?page=lunchtime_inlinecode_options8342.0625.2228.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_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 mmlt-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=lunchtime_inlinecode_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_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 mmlt-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=lunchtime_inlinecode_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script 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 mmlt-admin-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=lunchtime_inlinecode_options
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script 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 mmlt-script handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=lunchtime_inlinecode_options
    • > Notice in wp-content/plugins/lunchtime-inlinecode/assets/templates/mmlt-settings.php+425
    Undefined index: sRestaurantInlineHash

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 take a closer look at the following
  • 4× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/lunchtime-inlinecode/assets/templates/mmlt-settings.php
    • > /wp-content/plugins/lunchtime-inlinecode/assets/templates/mmlt-templates.php
    • > /wp-content/plugins/lunchtime-inlinecode/lunchtime-inlinecode.php
    • > /wp-content/plugins/lunchtime-inlinecode/assets/templates/mmlt-start-code.php

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (After you've installed and activated the plugin, go to **Settings -> Lunchtime InlineCode**, enter there the **RestaurantCode**, which you can find on [MenuPublisher -> Distribution -> Homepage](http://www.menupublisher.de/index.php?page=gastr_backend&spage=distr&sspage=inline#wp_inline "Distribution"). Save then click on **"+add code snippet"**.), #2 (Select a name for the snippet (it must be unique among all snippets), the layout, whether the snippet should show Lunch card and/or Menu. Then save.), #3 (Edit the page, where the data, that you selected in the snippet setup, should be displayed and add there the code via Lunchtime InlineCode button. **IMPORTANT**: keep in mind, that you should use only one code snippet on any page, otherwise you get an error and the output of the code is not correct.)
You can look at the official readme.txt

lunchtime-inlinecode/lunchtime-inlinecode.php Passed 13 tests

The main file in "Lunchtime InlineCode" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
90 characters long description:
This plugin renders lunch or menus from a restaurant on lunchtime directly on your website

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,892 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP47940942
JavaScript36887722
CSS140228

PHP code Passed 2 tests

This is a short overview 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.33
Average class complexity25.33
▷ Minimum class complexity11.00
▷ Maximum class complexity52.00
Average method complexity5.56
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods16
▷ Static methods16100.00%
▷ Public methods1062.50%
▷ Protected methods00.00%
▷ Private methods637.50%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants150.00%
▷ Class constants150.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin