89% recent-posts-widget-and-shortcode

Code Review | Recent Posts: Widget and Shortcode

WordPress plugin Recent Posts: Widget and Shortcode scored89%from 54 tests.

About plugin

  • Plugin page: recent-posts-widg...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-5.2.4
  • WordPress version: 6.3.1
  • First release: Dec 11, 2019
  • Latest release: Dec 11, 2019
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: getseofix (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /383 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.84ms] Passed 4 tests

A check of server-side resources used by Recent Posts: Widget and Shortcode
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0440.77 ▼2.06
Dashboard /wp-admin3.35 ▲0.0052.47 ▼17.28
Posts /wp-admin/edit.php3.40 ▲0.0449.44 ▼3.22
Add New Post /wp-admin/post-new.php5.93 ▲0.0487.73 ▼12.80
Media Library /wp-admin/upload.php3.28 ▲0.0440.39 ▲4.79

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

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

Browser metrics Passed 4 tests

Recent Posts: Widget and Shortcode: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.26 ▼0.162.04 ▲0.2343.25 ▼3.53
Dashboard /wp-admin2,213 ▲335.54 ▼0.1583.91 ▼17.2791.84 ▲47.92
Posts /wp-admin/edit.php2,112 ▲92.02 ▼0.0333.39 ▼11.4634.02 ▼0.03
Add New Post /wp-admin/post-new.php1,692 ▲14422.49 ▼1.00766.04 ▲91.5956.89 ▲3.86
Media Library /wp-admin/upload.php1,406 ▲64.20 ▼0.01110.59 ▲3.8480.78 ▲34.11

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin does not fully uninstall, leaving 10 options in the database
    • Recent_PostsInputField3
    • Recent_PostsInputField1
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • Recent_PostsInputField2
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent_posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
3 plugin tags: recent posts, related posts, posts shortcode

recent-posts-widget-and-shortcode/Recent_Posts.php 92% from 13 tests

The entry point to "Recent Posts: Widget and Shortcode" version 1.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("recent-posts-widget-and-shortcode.php" instead of "Recent_Posts.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin219 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP35543219

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.32
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods216.67%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.77MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenicon.png11.64KB3.20KB▼ 72.52%
screenshot-2.png166.38KB48.89KB▼ 70.61%
screenshot-1.png427.59KB129.74KB▼ 69.66%
thumb.png7.23KB0.13KB▼ 98.20%
promo.png30.21KB9.10KB▼ 69.87%