88% ratio-site-control

Code Review | Ratio. Site Control.

WordPress plugin Ratio. Site Control. scored 88% from 54 tests.

About plugin

  • Plugin page: ratio-site-control
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.8
  • WordPress version: 5.8.1
  • First release: Jul 27, 2017
  • Latest release: Jul 28, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: losvik (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 384 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼143.85ms] Passed 4 tests

Server-side resources used by Ratio. Site Control.
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.92 ▲0.0939.43 ▲6.16
Dashboard /wp-admin3.17 ▲0.1255.05 ▼1.20
Posts /wp-admin/edit.php3.29 ▲0.1848.89 ▲0.39
Add New Post /wp-admin/post-new.php5.54 ▲0.1199.95 ▼550.87
Media Library /wp-admin/upload.php3.12 ▲0.1135.67 ▼23.72
Ratio /wp-admin/admin.php?page=ratio3.0931.23
Facebook /wp-admin/admin.php?page=ratio-admin-facebook3.0930.16
Google analytics /wp-admin/admin.php?page=ratio-admin-google3.0936.26

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Ratio. Site Control.
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,752 ▲15616.05 ▲0.4824.34 ▲15.6249.30 ▼5.44
Dashboard /wp-admin3,006 ▲725.96 ▼0.00144.19 ▼0.27120.76 ▲1.60
Posts /wp-admin/edit.php2,778 ▲392.69 ▼0.0067.30 ▼4.4895.96 ▼3.82
Add New Post /wp-admin/post-new.php1,623 ▲4219.00 ▲1.24391.01 ▼19.73111.07 ▼10.03
Media Library /wp-admin/upload.php1,849 ▲425.03 ▲0.01149.03 ▼47.81122.50 ▼21.08
Ratio /wp-admin/admin.php?page=ratio1,1672.0560.0287.02
Facebook /wp-admin/admin.php?page=ratio-admin-facebook1,0952.0958.8682.32
Google analytics /wp-admin/admin.php?page=ratio-admin-google1,0892.0959.4587.34

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ratio-site-control/index.php
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ratio-site-control/admin/partials/ratio-admin.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Ratio_Public' not found in wp-content/plugins/ratio-site-control/public/class-ratio-public-google.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Ratio_Admin' not found in wp-content/plugins/ratio-site-control/admin/class-ratio-admin-facebook.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Ratio' not found in wp-content/plugins/ratio-site-control/admin/class-ratio-admin.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ratio-site-control/admin/partials/ratio-admin-facebook.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/ratio-site-control/includes/class-ratio.php:60
    • > PHP Fatal error
      Uncaught Error: Class 'Ratio_Admin' not found in wp-content/plugins/ratio-site-control/admin/class-ratio-admin-google.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Ratio_Public' not found in wp-content/plugins/ratio-site-control/public/class-ratio-public-facebook.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Ratio' not found in wp-content/plugins/ratio-site-control/public/class-ratio-public.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/ratio-site-control/admin/partials/ratio-admin-google.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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
3 plugin tags: google analytics, facebook sdk, facebook

ratio-site-control/ratio.php 85% from 13 tests

Analyzing the main PHP file in "Ratio. Site Control." version 1.0.0
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ratio-site-control.php" instead of "ratio.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected578 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP14112399542
JSON10036

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity6.57
▷ Minimum class complexity2.00
▷ Maximum class complexity27.00
Average method complexity2.09
▷ Minimum method complexity1.00
▷ Maximum method complexity19.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods37
▷ Static methods410.81%
▷ Public methods3491.89%
▷ Protected methods00.00%
▷ Private methods38.11%
Functions3
▷ Named functions133.33%
▷ Anonymous functions266.67%
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
There were not PNG files found in your plugin