84% onetone-companion

Code Review | OneTone Companion

WordPress plugin OneTone Companion scored 84% from 54 tests.

About plugin

  • Plugin page: onetone-companion
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9
  • WordPress version: 5.8.1
  • First release: Sep 20, 2017
  • Latest release: Aug 9, 2018
  • Number of updates: 29
  • Update frequency: every 11.1 days
  • Top authors: magictheme (100%)

Code review

54 tests

User reviews

1 review

Install metrics

7,000+ active / 93,072 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.27MB] [CPU: ▼146.43ms] Passed 4 tests

Server-side resources used by OneTone Companion
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.08 ▲0.3741.32 ▲19.13
Dashboard /wp-admin3.31 ▲0.2641.44 ▼5.33
Posts /wp-admin/edit.php3.43 ▲0.3246.52 ▲1.19
Add New Post /wp-admin/post-new.php5.68 ▲0.2485.96 ▼572.91
Media Library /wp-admin/upload.php3.26 ▲0.2628.72 ▼8.66

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 19 new files
Database: no new tables, 1 new option
New WordPress options
widget_onetone_recent_posts

Browser metrics Passed 4 tests

An overview of browser requirements for OneTone Companion
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,843 ▲24716.63 ▲1.0414.45 ▲5.9948.13 ▲1.02
Dashboard /wp-admin3,014 ▲836.64 ▲0.67136.92 ▼21.90136.46 ▲16.21
Posts /wp-admin/edit.php2,811 ▲722.73 ▲0.0172.50 ▲1.53107.24 ▲19.64
Add New Post /wp-admin/post-new.php1,706 ▲10218.98 ▲0.16372.13 ▲3.24105.95 ▼5.27
Media Library /wp-admin/upload.php1,873 ▲635.26 ▲0.22128.88 ▼20.06123.29 ▲11.63

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_onetone_recent_posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
The following issues need your attention
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/onetone-companion/includes/widget-recent-posts.php:3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/onetone-companion/includes/templates-importer/wordpress-importer.php on line 20
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/onetone-companion/includes/templates-importer/templates-importer.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/onetone-companion/includes/templates-importer/template-directory-tpl.php:3
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHWPINC/feed.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/onetone-companion/includes/templates-importer/templates-importer.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/onetone-companion/includes/metabox-options.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/onetone-companion/includes/templates-importer/templates-importer.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/import.php' (include_path='.:/usr/share/php') in wp-content/plugins/onetone-companion/includes/templates-importer/wordpress-importer.php on line 20
    • > PHP Warning
      include_once(ABSPATHWPINC/feed.php): failed to open stream: No such file or directory in wp-content/plugins/onetone-companion/includes/templates-importer/templates-importer.php on line 2
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/import.php): failed to open stream: No such file or directory in wp-content/plugins/onetone-companion/includes/templates-importer/wordpress-importer.php on line 20

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 Passed 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
2 plugin tags: theme options, theme templates

onetone-companion/onetone-companion.php Passed 13 tests

The entry point to "OneTone Companion" version 1.1.1 is a PHP file that has certain tags in its header comment area
37 characters long description:
Theme options and templates importer.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin3,804 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP107194702,897
CSS3864543
JavaScript36314364

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity44.17
▷ Minimum class complexity7.00
▷ Maximum class complexity183.00
Average method complexity5.93
▷ Minimum method complexity1.00
▷ Maximum method complexity50.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods105
▷ Static methods1514.29%
▷ Public methods9489.52%
▷ Protected methods43.81%
▷ Private methods76.67%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
There are no PNG files in this plugin