78% daylife

Code Review | Daylife

WordPress plugin Daylife scored78%from 54 tests.

About plugin

  • Plugin page: daylife
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-3.4.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2012
  • Latest release: Jul 26, 2012
  • Number of updates: 20
  • Update frequency: every 6.5 days
  • Top authors: aaroncampbell (65%)PeteMall (40%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,961 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▼0.10MB] [CPU: ▼10.39ms] Passed 4 tests

An overview of server-side resources used by Daylife
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.29 ▲1.85
Dashboard /wp-admin3.33 ▼0.0147.19 ▼12.61
Posts /wp-admin/edit.php3.38 ▲0.0243.88 ▼3.43
Add New Post /wp-admin/post-new.php5.47 ▼0.4272.44 ▼27.36
Media Library /wp-admin/upload.php3.25 ▲0.0236.51 ▲5.08
Daylife /wp-admin/options-general.php?page=daylife-options3.2028.90

Server storage [IO: ▲0.29MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Daylife
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲8313.23 ▼1.151.83 ▲0.2144.45 ▲5.46
Dashboard /wp-admin2,210 ▲225.91 ▲1.08106.10 ▲4.4541.34 ▼1.11
Posts /wp-admin/edit.php2,093 ▲41.99 ▼0.0740.50 ▼0.1036.30 ▼4.83
Add New Post /wp-admin/post-new.php6,216 ▲4,69726.24 ▲2.81936.77 ▲300.1264.47 ▲10.93
Media Library /wp-admin/upload.php1,392 ▲44.25 ▲0.0795.51 ▼2.8843.41 ▲1.28
Daylife /wp-admin/options-general.php?page=daylife-options1,0122.0522.1726.52

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=daylife-options
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=daylife-options
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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 add_action() in wp-content/plugins/daylife/inc/meta-box.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/daylife/inc/options.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/daylife/daylife.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Daylife Meta Box), #2 (Plugin Settings)
The official readme.txt might help

daylife/daylife.php Passed 13 tests

This is the main PHP file of "Daylife" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
115 characters long description:
Add high quality licensed images relevant to your blog posts from sources like Getty, AP, Reuters and US Presswire.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin426 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP46034326
JavaScript12069
CSS15031

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity12.00
▷ Minimum class complexity2.00
▷ Maximum class complexity25.00
Average method complexity2.69
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2388.46%
▷ Protected methods00.00%
▷ Private methods311.54%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.27MB with 0.16MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png222.21KB77.84KB▼ 64.97%
screenshot-2.png46.02KB14.13KB▼ 69.30%
images/daylife32.png3.89KB1.99KB▼ 48.97%