10% posts-carousel

Code Review | Posts Carousel

WordPress plugin Posts Carousel scored10%from 54 tests.

About plugin

  • Plugin page: posts-carousel
  • Plugin version: 1.0.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5
  • WordPress version: 6.3.1
  • First release: Sep 6, 2020
  • Latest release: Sep 6, 2020
  • Number of updates: 5
  • Update frequency: every 5.4 days
  • Top authors: lnksync (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /346 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/posts-carousel/settings.php+3
    var_dump() expects at least 1 parameter, 0 given

Server metrics [RAM: ▼1.96MB] [CPU: ▼54.99ms] Passed 4 tests

Analyzing server-side resources used by Posts Carousel
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.03 ▼1.434.43 ▼38.60
Dashboard /wp-admin2.05 ▼1.265.48 ▼42.06
Posts /wp-admin/edit.php2.05 ▼1.315.31 ▼43.12
Add New Post /wp-admin/post-new.php2.05 ▼3.845.06 ▼96.18
Media Library /wp-admin/upload.php2.05 ▼1.185.55 ▼26.25

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Posts Carousel: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲8113.29 ▼1.114.22 ▲2.4841.11 ▼3.09
Dashboard /wp-admin2,225 ▲344.88 ▲0.0199.98 ▼0.9540.12 ▼4.18
Posts /wp-admin/edit.php2,105 ▲162.01 ▲0.0234.73 ▲1.4834.36 ▼1.90
Add New Post /wp-admin/post-new.php1,547 ▲2823.24 ▲0.17665.26 ▲16.0953.52 ▲0.57
Media Library /wp-admin/upload.php1,404 ▲164.15 ▼0.0795.68 ▼4.0945.90 ▲2.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Warning in wp-content/plugins/posts-carousel/settings.php+3
    var_dump() expects at least 1 parameter, 0 given
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      var_dump() expects at least 1 parameter, 0 given in wp-content/plugins/posts-carousel/settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/posts-carousel/settings.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 83% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Donate link: Invalid url: ""
You can look at the official readme.txt

posts-carousel/lnksync-posts-carousel.php 69% from 13 tests

The main PHP script in "Posts Carousel" version 1.0.1 is automatically included on every request by WordPress
The following require your attention:
  • Requires at least: The required version number did not match the one declared in readme.txt ("4.0" instead of "5.2")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("posts-carousel.php" instead of "lnksync-posts-carousel.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Requires PHP: The required version number did not match the one declared in readme.txt ("5.4" instead of "7.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin842 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript32813583
PHP2917259

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.51
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%
Functions7
▷ Named functions7100.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
1 PNG file occupies 0.14MB with 0.10MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/premium.png146.50KB46.54KB▼ 68.23%