83% a-smart-excerpt

Code Review | A Smart Excerpt

WordPress plugin A Smart Excerpt scored83%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: 6.3.1
  • 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

50+ active /8,004 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: ▼0.24MB] [CPU: ▼14.16ms] Passed 4 tests

An overview of server-side resources used by A Smart Excerpt
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0535.84 ▼2.62
Dashboard /wp-admin3.40 ▲0.1047.79 ▼2.95
Posts /wp-admin/edit.php3.45 ▲0.0952.72 ▼3.85
Add New Post /wp-admin/post-new.php4.69 ▼1.2045.80 ▼47.21
Media Library /wp-admin/upload.php3.32 ▲0.0938.73 ▲4.82
Smart Excerpt /wp-admin/options-general.php?page=smaExc_plugin3.2733.84

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for A Smart Excerpt
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲6613.26 ▼1.121.90 ▲0.2452.59 ▲10.09
Dashboard /wp-admin2,210 ▲224.87 ▼0.05107.92 ▲5.4040.32 ▼3.06
Posts /wp-admin/edit.php2,093 ▲12.01 ▼0.0239.39 ▼5.0134.40 ▼3.35
Add New Post /wp-admin/post-new.php1,422 ▼11322.30 ▼0.88560.92 ▼127.6444.41 ▼18.38
Media Library /wp-admin/upload.php1,392 ▲44.23 ▲0.03100.71 ▼1.0544.17 ▼3.16
Smart Excerpt /wp-admin/options-general.php?page=smaExc_plugin1,0302.0726.7128.53

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

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 require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Screenshots: Please add images for these screenshots: #1 (The admin panel 1), #2 (The admin panel 2)
You can look at the official readme.txt

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

The principal PHP file in "A Smart Excerpt" v. 1.4 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal 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 must use dashes instead of underscores, and it must be lowercase
  • Domain Path: The domain path folder does not exist ("/lang")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 188 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected408 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14070408

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.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
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods110.00%
▷ Public methods550.00%
▷ Protected methods00.00%
▷ Private methods550.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ 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
No PNG files were detected