84% oop-plugin-template-solution

Code Review | Object Oriented Plugin Template Solution

WordPress plugin Object Oriented Plugin Template Solution scored 84% from 54 tests.

About plugin

  • Plugin page: oop-plugin-templa...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.4
  • WordPress version: 6.3.1
  • First release: Nov 5, 2012
  • Latest release: Aug 13, 2016
  • Number of updates: 7
  • Update frequency: every 196.7 days
  • Top authors: convissor (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 2,997 total downloads

Benchmarks

Plugin footprint 83% from 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.08MB] [CPU: ▼1.45ms] Passed 4 tests

Server-side resources used by Object Oriented Plugin Template Solution
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.16 ▼2.24
Dashboard /wp-admin3.41 ▲0.1043.78 ▼2.23
Posts /wp-admin/edit.php3.52 ▲0.1646.25 ▲1.07
Add New Post /wp-admin/post-new.php5.99 ▲0.1093.92 ▼0.47
Media Library /wp-admin/upload.php3.33 ▲0.1035.16 ▼0.86
Object Oriented Plugin Template Solution /wp-admin/options-general.php?page=oop-plugin-template-solution3.3031.23

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 10 new files
Database: 1 new table, 7 new options
New tables
wp_oop_plugin_template_solution_login
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
oop-plugin-template-solution-options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Object Oriented Plugin Template Solution
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.63 ▼0.761.69 ▼0.4338.92 ▼9.19
Dashboard /wp-admin2,210 ▲225.86 ▲0.97109.26 ▼0.7739.17 ▼2.19
Posts /wp-admin/edit.php2,093 ▲41.96 ▼0.1741.16 ▲2.9435.23 ▼1.16
Add New Post /wp-admin/post-new.php1,536 ▲323.27 ▲0.20658.22 ▲18.7169.28 ▲16.68
Media Library /wp-admin/upload.php1,395 ▲104.24 ▼0.0795.99 ▼6.6941.69 ▼0.18
Object Oriented Plugin Template Solution /wp-admin/options-general.php?page=oop-plugin-template-solution8312.0722.2324.62

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
Please fix the following
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_blog_prefix() on null in wp-content/plugins/oop-plugin-template-solution/oop-plugin-template-solution.php:165
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/oop-plugin-template-solution/tests/TestCase.php on line 90
    • > PHP Fatal error
      Uncaught Error: Class 'oop_plugin_template_solution' not found in wp-content/plugins/oop-plugin-template-solution/admin.php:54
    • > PHP Fatal error
      require_once(): Failed opening required 'PHPUnit/Autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/oop-plugin-template-solution/tests/TestCase.php on line 90
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_blog_prefix() on null in wp-content/plugins/oop-plugin-template-solution/oop-plugin-template-solution.php:165

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: multisite, skeleton, template, translation, object oriented...

oop-plugin-template-solution/oop-plugin-template-solution.php Passed 13 tests

The entry point to "Object Oriented Plugin Template Solution" version 1.1.2 is a PHP file that has certain tags in its header comment area
53 characters long description:
A well engineered template for creating plugins using

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin732 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP5186655651
Bourne Shell311081

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity11.80
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods55
▷ Static methods712.73%
▷ Public methods3360.00%
▷ Protected methods2240.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants120.00%
▷ Class constants480.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin