68% todays-posts

Code Review | Todays Posts

WordPress plugin Todays Posts scored68%from 54 tests.

About plugin

  • Plugin page: todays-posts
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0.1
  • WordPress version: 6.3.1
  • First release: Jun 11, 2014
  • Latest release: Dec 4, 2014
  • Number of updates: 30
  • Update frequency: every 5.9 days
  • Top authors: masud987 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,455 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▼1.82MB] [CPU: ▼50.16ms] Passed 4 tests

Analyzing server-side resources used by Todays Posts
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.294.97 ▼31.62
Dashboard /wp-admin2.19 ▼1.116.23 ▼41.22
Posts /wp-admin/edit.php2.19 ▼1.176.24 ▼41.89
Add New Post /wp-admin/post-new.php2.19 ▼3.707.25 ▼85.90
Media Library /wp-admin/upload.php2.19 ▼1.046.42 ▼27.48
Todays Posts /wp-admin/options-general.php?page=todays_posts2.196.20

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 6 new files
Database: no new tables, 8 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
tpp_settings
widget_recent-comments
db_upgraded
tpp_support

Browser metrics Passed 4 tests

A check of browser resources used by Todays Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,827 ▲9213.31 ▼0.941.71 ▼0.0038.16 ▼5.83
Dashboard /wp-admin2,226 ▲525.96 ▲0.9697.58 ▼17.7036.87 ▼5.85
Posts /wp-admin/edit.php2,131 ▲422.40 ▲0.2640.20 ▼1.5233.69 ▼1.30
Add New Post /wp-admin/post-new.php1,533 ▼023.43 ▲0.31640.18 ▼68.1137.12 ▼28.61
Media Library /wp-admin/upload.php1,424 ▲334.49 ▲0.3196.56 ▼8.4043.82 ▼3.47
Todays Posts /wp-admin/options-general.php?page=todays_posts1,4042.8866.4429.71

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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 did not uninstall without warnings or errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tp_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie WordPress options were found after uninstall: 8 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • tpp_settings
    • tpp_support
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=todays_posts
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the tp_css handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=todays_posts
    • > Notice in wp-content/plugins/todays-posts/class.settings-api.php+139
    Undefined index: label

SRP 50% from 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
Please fix the following items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/todays-posts/todays-posts.php on line 28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/todays-posts/todays-posts.php:28

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 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
Please fix the following attributes:
  • Contributors: Plugin contributors not specified
The official readme.txt might help

todays-posts/todays-posts.php Passed 13 tests

The main file in "Todays Posts" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
45 characters long description:
Displays posts but only from the current day.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected607 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP2154185585
CSS32022

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity23.50
▷ Minimum class complexity3.00
▷ Maximum class complexity44.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods31
▷ Static methods00.00%
▷ Public methods31100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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