78% post-content-shortcodes

Code Review | Post Content Shortcodes

WordPress plugin Post Content Shortcodes scored78%from 54 tests.

About plugin

  • Plugin page: post-content-shor...
  • Plugin version: 1.0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.4
  • WordPress version: 6.3.1
  • First release: Aug 30, 2011
  • Latest release: Apr 3, 2018
  • Number of updates: 63
  • Update frequency: every 38.2 days
  • Top authors: cgrymala (100%)

Code review

54 tests

User reviews

31 reviews

Install metrics

4,000+ active /96,543 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▲2.40ms] Passed 4 tests

A check of server-side resources used by Post Content Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3543.93 ▼2.14
Dashboard /wp-admin3.66 ▲0.3653.70 ▲0.03
Posts /wp-admin/edit.php3.78 ▲0.4255.06 ▲6.37
Add New Post /wp-admin/post-new.php6.24 ▲0.3598.59 ▲7.18
Media Library /wp-admin/upload.php3.59 ▲0.3540.75 ▲5.35
Post Content Shortcodes /wp-admin/options-general.php?page=post-content-shortcodes3.5533.66

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Post Content Shortcodes
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲3414.69 ▲0.451.88 ▼0.2243.25 ▼0.91
Dashboard /wp-admin2,196 ▲165.50 ▼0.1888.18 ▼1.1041.57 ▼2.64
Posts /wp-admin/edit.php2,104 ▲12.00 ▼0.1634.61 ▼2.6338.40 ▼0.39
Add New Post /wp-admin/post-new.php1,545 ▲1918.25 ▼4.84626.07 ▲7.3655.50 ▲0.34
Media Library /wp-admin/upload.php1,407 ▲74.19 ▼0.0397.19 ▼3.5443.80 ▼1.78
Post Content Shortcodes /wp-admin/options-general.php?page=post-content-shortcodes8362.0023.0428.42

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_pcs-list-widget
    • widget_pcs-content-widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 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
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/post-content-shortcodes/classes/class-post-content-shortcodes-admin.php
    • > /wp-content/plugins/post-content-shortcodes/classes/class-post-content-shortcodes.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/post-content-shortcodes/classes/class-post-content-widgets.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/post-content-shortcodes/post-content-shortcodes.php:17

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (An example of the post-list shortcode being used within the Twenty Seventeen theme, with the default PCS styles **disabled**)
The official readme.txt might help

post-content-shortcodes/post-content-shortcodes.php Passed 13 tests

This is the main PHP file of "Post Content Shortcodes" version 1.0.1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
78 characters long description:
Adds shortcodes to show the content of another post or to show a list of posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,778 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42098221,430
Markdown11430288
CSS17660

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.65
Average class complexity64.60
▷ Minimum class complexity9.00
▷ Maximum class complexity210.00
Average method complexity6.78
▷ Minimum method complexity1.00
▷ Maximum method complexity55.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods55
▷ Static methods23.64%
▷ Public methods4480.00%
▷ Protected methods814.55%
▷ Private methods35.45%
Functions0
▷ Named functions00.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
3 compressed PNG files occupy 0.11MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot3.png20.17KB19.05KB▼ 5.53%
screenshot2.png62.48KB60.65KB▼ 2.93%
screenshot.png27.46KB26.56KB▼ 3.30%