58% simple-timeline

Code Review | Simple Timeline

WordPress plugin Simple Timeline scored58%from 54 tests.

About plugin

  • Plugin page: simple-timeline
  • Plugin version: 0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.1-3.9.0
  • WordPress version: 6.3.1
  • First release: Jul 16, 2014
  • Latest release: Jul 18, 2014
  • Number of updates: 21
  • Update frequency: every 0.4 days
  • Top authors: kuma275m (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /959 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼9.08ms] Passed 4 tests

This is a short check of server-side resources used by Simple Timeline
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.38 ▼0.51
Dashboard /wp-admin3.32 ▼0.0352.43 ▼14.14
Posts /wp-admin/edit.php3.37 ▲0.0149.98 ▼2.22
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.37 ▼19.44
Media Library /wp-admin/upload.php3.24 ▲0.0139.13 ▲1.75
添加时间轴 /wp-admin/admin.php?page=STL_admin_add3.2430.43
时间轴管理 /wp-admin/admin.php?page=STL_admin3.2538.95
修改时间轴 /wp-admin/admin.php?page=STL_admin_edit3.2528.17

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 12 new files
Database: 1 new table, 7 new options
New tables
wp_stl_node
New WordPress options
widget_recent-posts
STL_db_version
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Simple Timeline
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8713.56 ▼0.711.67 ▼0.2444.34 ▲4.57
Dashboard /wp-admin2,252 ▲495.79 ▲0.94113.60 ▲8.4152.19 ▲6.13
Posts /wp-admin/edit.php2,131 ▲312.01 ▲0.0236.66 ▼4.3043.88 ▲7.18
Add New Post /wp-admin/post-new.php1,575 ▲3523.07 ▼0.05665.88 ▲60.3457.39 ▲2.67
Media Library /wp-admin/upload.php1,425 ▲224.23 ▲0.0398.55 ▼5.8452.04 ▲6.07
添加时间轴 /wp-admin/admin.php?page=STL_admin_add1,5526.57127.1971.39
时间轴管理 /wp-admin/admin.php?page=STL_admin8292.0224.9036.70
修改时间轴 /wp-admin/admin.php?page=STL_admin_edit1,5556.54132.4148.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
  • Zombie tables detected upon uninstall: 1 table
    • wp_stl_node
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=STL_admin_add
    • > Notice in wp-content/plugins/simple-timeline/STL_node_add.php+34
    Undefined index: stl_node_content
    • > GET request to /wp-admin/admin.php?page=STL_admin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/admin.php?page=STL_admin
    • > User notice in wp-includes/functions.php+5905
    Function wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Notice in wp-content/plugins/simple-timeline/STL_node_edit.php+43
    Undefined variable: nodes
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Notice in wp-content/plugins/simple-timeline/STL_node_edit.php+43
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Notice in wp-content/plugins/simple-timeline/STL_node_edit.php+32
    Trying to get property 'node_date' of non-object
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Notice in wp-content/plugins/simple-timeline/STL_node_edit.php+33
    Trying to get property 'id' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Notice in wp-content/plugins/simple-timeline/STL_node_edit.php+39
    Trying to get property 'node_status' of non-object
    • > GET request to /wp-admin/admin.php?page=STL_admin_edit
    • > Notice in wp-content/plugins/simple-timeline/STL_node_edit.php+43
    Trying to get property 'node_content' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_safe_redirect() in wp-content/plugins/simple-timeline/STL_node_edit.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_editor() in wp-content/plugins/simple-timeline/STL_node_add.php:34
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/simple-timeline/STL_node_admin.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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 to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === simple-timeline === )
  • Screenshots: Please add images for these screenshots: #1 (Admin page), #2 (Front-end performance), #3 (Adding/Editing timeline node page)
The official readme.txt is a good inspiration

simple-timeline/wp-simple-timeline.php 92% from 13 tests

The main PHP file in "Simple Timeline" ver. 0.9 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-timeline.php" instead of "wp-simple-timeline.php")

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
No dangerous file extensions were detected370 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP42812247
CSS13674
PO File1161649

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
css/version_line.png0.15KB0.08KB▼ 45.03%