84% posts-by-shortcode

Code Review | Posts By Shortcode

WordPress plugin Posts By Shortcode scored84%from 54 tests.

About plugin

  • Plugin page: posts-by-shortcode
  • Plugin version: 1.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0
  • WordPress version: 6.3.1
  • First release: Jun 24, 2022
  • Latest release: Oct 5, 2022
  • Number of updates: 11
  • Update frequency: every 9.4 days
  • Top authors: rounakkumar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /798 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.02MB] [CPU: ▼6.07ms] Passed 4 tests

A check of server-side resources used by Posts By Shortcode
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.04 ▼0.13
Dashboard /wp-admin3.33 ▲0.0252.98 ▼0.77
Posts /wp-admin/edit.php3.38 ▲0.0245.90 ▼3.70
Add New Post /wp-admin/post-new.php5.91 ▲0.0287.02 ▼13.55
Media Library /wp-admin/upload.php3.25 ▲0.0238.83 ▼6.25

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 21 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Posts By Shortcode: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲7213.63 ▼0.821.94 ▼0.1643.78 ▼1.28
Dashboard /wp-admin2,219 ▲314.84 ▼1.01105.23 ▼16.8641.77 ▼0.43
Posts /wp-admin/edit.php2,108 ▲192.05 ▲0.0536.84 ▼1.1834.41 ▼4.76
Add New Post /wp-admin/post-new.php1,546 ▲2723.15 ▼0.08661.69 ▼25.5159.18 ▲4.12
Media Library /wp-admin/upload.php1,407 ▲164.24 ▲0.0896.44 ▼10.4244.40 ▼0.59

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
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 75% from 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 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 19× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_4.php on line 4
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_2.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/posts-by-shortcode/posts-by-shortcode-rk.php:13
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_5.php on line 4
    • > PHP Notice
      Undefined variable: content in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_3.php on line 2
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_3.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_3.php:4
    • > PHP Notice
      Undefined variable: result in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_1.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_1.php:4
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/posts-by-shortcode/templates/pbs_rk_layout_4.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: posts by shortcode, posts shortcode, posts, show posts by shortcode, show posts

posts-by-shortcode/posts-by-shortcode-rk.php 92% from 13 tests

This is the main PHP file of "Posts By Shortcode" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("posts-by-shortcode.php" instead of "posts-by-shortcode-rk.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin706 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP79223360
CSS112346

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.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

PNG files should be compressed to save space and minimize bandwidth usage
11 PNG files occupy 4.58MB with 3.34MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-7.png470.72KB118.35KB▼ 74.86%
assets/banner-772x250-rtl.png126.32KB40.32KB▼ 68.08%
assets/screenshot-5.png729.42KB170.78KB▼ 76.59%
assets/banner-772x250.png146.50KB40.32KB▼ 72.48%
assets/screenshot-3.png385.45KB105.12KB▼ 72.73%