93% a-smart-excerpt

Code Review | A Smart Excerpt

WordPress plugin A Smart Excerpt scored 93% from 54 tests.

About plugin

  • Plugin page: a-smart-excerpt
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.4.1
  • WordPress version: 5.9.2
  • First release: Sep 19, 2015
  • Latest release: Feb 7, 2016
  • Number of updates: 52
  • Update frequency: every 2.7 days
  • Top authors: Calogero1975 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active / 5,523 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼0.24MB] [CPU: ▼307.48ms] Passed 4 tests

An overview of server-side resources used by A Smart Excerpt
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.0956.93 ▲2.33
Dashboard /wp-admin3.50 ▲0.1035.81 ▲0.79
Posts /wp-admin/edit.php3.73 ▲0.1041.23 ▲3.91
Add New Post /wp-admin/post-new.php5.75 ▼1.2558.18 ▼1,235.92
Media Library /wp-admin/upload.php3.39 ▲0.0925.82 ▲2.89
Smart Excerpt /wp-admin/options-general.php?page=smaExc_plugin3.3326.09

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for A Smart Excerpt
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲4615.88 ▲0.245.91 ▲0.252.19 ▼0.52
Dashboard /wp-admin2,894 ▲336.12 ▲0.03117.69 ▼14.89155.26 ▼6.18
Posts /wp-admin/edit.php2,693 ▼13.26 ▲0.0163.92 ▼0.15141.18 ▼5.45
Add New Post /wp-admin/post-new.php1,682 ▲2121.23 ▲4.58385.45 ▼37.86183.40 ▲26.12
Media Library /wp-admin/upload.php1,706 ▲115.51 ▼0.01141.92 ▼6.27183.37 ▼8.57
Smart Excerpt /wp-admin/options-general.php?page=smaExc_plugin1,3792.3856.70126.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% 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)
Almost there, just fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=smaExc_plugin
    • > Warning in wp-content/plugins/a-smart-excerpt/smart-excerpt.php+465
    in_array() expects parameter 2 to be array, bool given

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found


Plugin configuration 79% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (The admin panel 1), #2 (The admin panel 2)
You can take inspiration from this readme.txt

a-smart-excerpt/smart-excerpt.php 69% from 13 tests

"A Smart Excerpt" version 1.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("a-smart-excerpt.php" instead of "smart-excerpt.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Description: The description should be shorter than 140 characters (currently 188 characters long)
  • Domain Path: The domain path points to a folder that does not exist ("/lang")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected408 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity67.00
▷ Minimum class complexity67.00
▷ Maximum class complexity67.00
Average method complexity7.60
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods110.00%
▷ Public methods550.00%
▷ Protected methods00.00%
▷ Private methods550.00%
▷ Named functions3100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin