10% imagine

Code Review | Imagine

WordPress plugin Imagine scored10%from 54 tests.

About plugin

  • Plugin page: imagine
  • Plugin version: 0.99.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.2.2
  • WordPress version: 6.3.1
  • First release: May 21, 2015
  • Latest release: Jun 12, 2015
  • Number of updates: 99
  • Update frequency: every 0.2 days
  • Top authors: mmichel (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,134 total downloads

Benchmarks

Plugin footprint 58% 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
These installer errors require your attention
  • The plugin cannot be installed
    • > Compile error in wp-content/plugins/imagine/imagine-ajax.php+647
    'break' not in the 'loop' or 'switch' context

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

Analyzing server-side resources used by Imagine
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0042.75 ▲1.09
Dashboard /wp-admin3.31 ▲0.0048.90 ▲1.25
Posts /wp-admin/edit.php3.36 ▲0.0048.00 ▼4.92
Add New Post /wp-admin/post-new.php5.89 ▲0.0083.89 ▼28.93
Media Library /wp-admin/upload.php3.23 ▲0.0037.29 ▼0.10

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 66 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for Imagine
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.28 ▼0.121.97 ▲0.2142.75 ▼3.89
Dashboard /wp-admin2,198 ▲275.60 ▼0.0592.37 ▲3.2842.49 ▼4.26
Posts /wp-admin/edit.php2,103 ▲31.97 ▼0.0037.46 ▲1.9136.36 ▼2.08
Add New Post /wp-admin/post-new.php1,526 ▼023.12 ▲0.06652.77 ▼19.6254.96 ▼6.77
Media Library /wp-admin/upload.php1,400 ▼04.14 ▲0.04102.84 ▼9.6746.45 ▼1.64

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 0% 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
The following issues need your attention
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/imagine/admin/template-placeholder.php
  • 45× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Notice
      Undefined variable: tempinfo in wp-content/plugins/imagine/admin/edit-template.php on line 9
    • > PHP Notice
      Undefined variable: tempinfo in wp-content/plugins/imagine/admin/edit-template.php on line 7
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/imagine/admin/edit-gallery.php on line 7
    • > PHP Notice
      Trying to get property 'tempName' of non-object in wp-content/plugins/imagine/admin/edit-template.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/imagine/admin/edit-album.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/imagine/admin/admin-gallery.php:13
    • > PHP Notice
      Undefined variable: tempinfo in wp-content/plugins/imagine/admin/edit-template.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/imagine/templates/imagine-gallery-wall.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/imagine/modules/imagine-meta-box.php:19
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_row() on null in wp-content/plugins/imagine/templates/imagine-album-minified.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: gallery, images, ajax, albums, pictures...

imagine/index.php 85% from 13 tests

The entry point to "Imagine" version 0.99.9 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("imagine.php" instead of "index.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
Success! There were no dangerous files found in this plugin7,534 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript76455492,456
SVG1112,213
PHP326072782,031
CSS75711618
PO File188119193
XML10023

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
9 PNG files occupy 0.29MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/imagine-logo-400px.png124.61KB35.01KB▼ 71.90%
img/imagine-logo-100px.png15.90KB5.85KB▼ 63.20%
templates/images/shadow.png30.08KB15.52KB▼ 48.41%
img/imagine-logo-200px.png46.22KB13.82KB▼ 70.11%
templates/images/nav.png1.69KB0.45KB▼ 73.12%