83% shortcuts-for-front-page-and-posts-page

Code Review | Shortcuts for Front Page and Posts Page

WordPress plugin Shortcuts for Front Page and Posts Page scored 83% from 54 tests.

About plugin

  • Plugin page: shortcuts-for-fro...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.7.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2017
  • Latest release: Jan 25, 2017
  • Number of updates: 7
  • Update frequency: every 0.3 days
  • Top authors: romain-d (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 583 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼7.57ms] Passed 4 tests

This is a short check of server-side resources used by Shortcuts for Front Page and Posts Page
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.75 ▼3.34
Dashboard /wp-admin3.31 ▲0.0143.54 ▼7.31
Posts /wp-admin/edit.php3.36 ▲0.0044.93 ▼2.22
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.57 ▼17.40
Media Library /wp-admin/upload.php3.23 ▲0.0033.73 ▼0.87

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Shortcuts for Front Page and Posts Page
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9014.48 ▲0.182.17 ▲0.4138.06 ▼7.72
Dashboard /wp-admin2,203 ▲155.83 ▲0.9099.61 ▼0.4236.41 ▼8.18
Posts /wp-admin/edit.php2,086 ▼62.11 ▲0.1237.75 ▼4.6634.88 ▲0.13
Add New Post /wp-admin/post-new.php1,537 ▲423.29 ▼0.01649.77 ▲59.0653.31 ▼0.25
Media Library /wp-admin/upload.php1,388 ▼04.18 ▼0.0394.80 ▼1.2841.20 ▼0.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/shortcuts-for-front-page-and-posts-page/shortcuts-front-page-posts-page.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 86% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: navigation, admin, pages, shortcuts, administration

shortcuts-for-front-page-and-posts-page/shortcuts-front-page-posts-page.php 69% from 13 tests

The principal PHP file in "Shortcuts for Front Page and Posts Page" v. 1.0.1 is loaded by WordPress automatically on each request
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("shortcuts-for-front-page-and-posts-page.php" instead of "shortcuts-front-page-posts-page.php")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/languages")
  • Domain Path: Use only dashes and lowercase characters for the domain path ("languages")

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
Everything looks great! No dangerous files found in this plugin104 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP1173648
PO File16730
JSON10015
Markdown18011

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity2.40
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods360.00%
▷ Public methods480.00%
▷ Protected methods120.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshots/demo.png17.31KB6.18KB▼ 64.30%