72% theme-companion

Code Review | Theme Companion

WordPress plugin Theme Companion scored72%from 54 tests.

About plugin

  • Plugin page: theme-companion
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Nov 3, 2014
  • Latest release: Nov 3, 2014
  • Number of updates: 11
  • Update frequency: every 166.5 days
  • Top authors: Frumph (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,486 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.71ms] Passed 4 tests

Server-side resources used by Theme Companion
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0137.57 ▼9.42
Dashboard /wp-admin3.34 ▲0.0449.21 ▼7.12
Posts /wp-admin/edit.php3.39 ▲0.0449.37 ▼0.51
Add New Post /wp-admin/post-new.php5.92 ▲0.0493.69 ▼1.78
Media Library /wp-admin/upload.php3.26 ▲0.0442.64 ▲5.14
Companion /wp-admin/themes.php?page=companion3.2231.44

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Theme Companion
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.70 ▲0.301.84 ▼0.0442.23 ▼5.25
Dashboard /wp-admin2,199 ▲255.63 ▲0.0492.16 ▼0.9338.78 ▼7.21
Posts /wp-admin/edit.php2,104 ▲42.00 ▼0.0440.24 ▲2.6835.04 ▼0.92
Add New Post /wp-admin/post-new.php1,548 ▲323.28 ▲0.01670.15 ▼15.0651.57 ▲1.32
Media Library /wp-admin/upload.php1,401 ▼24.24 ▲0.07101.10 ▲0.8345.34 ▼0.67
Companion /wp-admin/themes.php?page=companion1,8662.5656.7770.21

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/themes.php?page=companion
    • > Notice in wp-content/plugins/theme-companion/companion_core.php+146
    Trying to access array offset on value of type null

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/theme-companion/edit_area/edit_area_compressor.php
    • > /wp-content/plugins/theme-companion/includes/ccexamples.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function companion_pluginfo() in wp-content/plugins/theme-companion/includes/cchelp.php:18
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/theme-companion/edit_area/edit_area_compressor.php on line 71
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/theme-companion/companion_core.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/theme-companion/companion.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/theme-companion/includes/cceditor.php:6

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: theme, css, multisite, companion, plugin...

theme-companion/companion.php 92% from 13 tests

Analyzing the main PHP file in "Theme Companion" version 1.0.2
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("theme-companion.php" instead of "companion.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
No dangerous file extensions were detected8,459 lines of code in 106 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript937721,0567,115
PHP68799619
CSS59122607
HTML260118

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity54.00
▷ Minimum class complexity54.00
▷ Maximum class complexity54.00
Average method complexity4.12
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
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
edit_area/images/opacity.png0.14KB0.09KB▼ 34.01%