93% vintagejs

Code Review | Vintage.js

WordPress plugin Vintage.js scored 93% from 54 tests.

About plugin

  • Plugin page: vintagejs
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Jun 2, 2012
  • Latest release: Jun 2, 2012
  • Number of updates: 2
  • Update frequency: every 2.0 days
  • Top authors: modemlooper (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,037 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼143.18ms] Passed 4 tests

Analyzing server-side resources used by Vintage.js
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.0346.73 ▲8.82
Dashboard /wp-admin3.08 ▲0.0360.36 ▼1.23
Posts /wp-admin/edit.php3.14 ▲0.0342.79 ▼8.39
Add New Post /wp-admin/post-new.php5.44 ▲0.0195.68 ▼557.47
Media Library /wp-admin/upload.php3.03 ▲0.0334.29 ▼5.62
Vintage JS /wp-admin/themes.php?page=vintagejs3.0039.52

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for Vintage.js
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,824 ▲25216.32 ▲0.7620.92 ▲9.5446.05 ▼3.27
Dashboard /wp-admin2,974 ▲475.88 ▼0.06138.66 ▼35.37111.82 ▼9.95
Posts /wp-admin/edit.php2,746 ▲72.73 ▲0.0169.42 ▼7.4495.28 ▲6.78
Add New Post /wp-admin/post-new.php1,599 ▲1818.75 ▲0.06426.71 ▼13.80110.99 ▼12.52
Media Library /wp-admin/upload.php1,817 ▲105.05 ▲0.02165.28 ▼11.56127.19 ▼2.21
Vintage JS /wp-admin/themes.php?page=vintagejs1,0322.0661.2872.81

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require(WP_PLUGIN_DIR/vintagejs/admin/admin.php): failed to open stream: No such file or directory in wp-content/plugins/vintagejs/loader.php on line 11
    • > PHP Fatal error
      require(): Failed opening required 'WP_PLUGIN_DIR/vintagejs/admin/admin.php' (include_path='.:/usr/share/php') in wp-content/plugins/vintagejs/loader.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/vintagejs/admin/admin.php:2
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/vintagejs/loader.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === vintagejs === )
  • Screenshots: Add images for these screenshots: #1 (upload option), #2 (vintage image filter)
The official readme.txt might help

vintagejs/loader.php 92% from 13 tests

"Vintage.js" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("vintagejs.php" instead of "loader.php")

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
There were no executable files found in this plugin245 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP24216130
JavaScript352687
CSS10028

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.36MB with 0.22MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png314.74KB115.18KB▼ 63.40%
css/clock.png4.16KB1.64KB▼ 60.64%
screenshot-1.png47.84KB18.42KB▼ 61.49%