10% pet-manager

Code Review | Pet Manager

WordPress plugin Pet Manager scored10%from 54 tests.

About plugin

  • Plugin page: pet-manager
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.9
  • WordPress version: 6.3.1
  • First release: Feb 10, 2013
  • Latest release: Nov 17, 2016
  • Number of updates: 35
  • Update frequency: every 39.3 days
  • Top authors: Dianakc (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

50+ active /8,217 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/pet-manager/inc/widgets.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; PET_Widget_Searchform has a deprecated constructor

Server metrics [RAM: ▼1.75MB] [CPU: ▼58.51ms] Passed 4 tests

This is a short check of server-side resources used by Pet Manager
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.29 ▼1.226.04 ▼37.72
Dashboard /wp-admin2.31 ▼1.087.48 ▼58.95
Posts /wp-admin/edit.php2.31 ▼1.097.82 ▼44.06
Add New Post /wp-admin/post-new.php2.31 ▼3.626.36 ▼93.32
Media Library /wp-admin/upload.php2.31 ▼0.967.71 ▼29.66
Add Pet /wp-admin/post-new.php?post_type=pet2.318.66
Options & About /wp-admin/edit.php?post_type=pet&page=pet_options_page2.317.99
Pets /wp-admin/edit.php?post_type=pet2.317.94

Server storage [IO: ▲0.22MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Pet Manager: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲15313.83 ▼0.588.60 ▲6.8541.19 ▼2.87
Dashboard /wp-admin2,226 ▲555.52 ▼0.1093.78 ▲3.9681.39 ▲40.06
Posts /wp-admin/edit.php2,137 ▲372.10 ▲0.1235.82 ▼0.3937.12 ▼1.24
Add New Post /wp-admin/post-new.php1,562 ▲3622.92 ▼0.28700.93 ▲55.5066.68 ▲5.28
Media Library /wp-admin/upload.php1,428 ▲344.24 ▲0.0496.71 ▼1.5975.29 ▲27.11
Add Pet /wp-admin/post-new.php?post_type=pet2,4797.87182.68137.80
Options & About /wp-admin/edit.php?post_type=pet&page=pet_options_page9522.0523.3033.77
Pets /wp-admin/edit.php?post_type=pet1,1471.9234.7636.32

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/pet-manager/inc/widgets.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; PET_Widget_Searchform has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pet
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/pet-manager/inc/widgets.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; PET_Widget_Searchform has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pet
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/pet-manager/inc/widgets.php+49
    Methods with the same name as their class will not be constructors in a future version of PHP; PET_Widget_Display has a deprecated constructor
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pet
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/pet-manager/pet-manager.php+94
    Function create_function() is deprecated
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=pet
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 8× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/pet-manager/inc/form.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/pet-manager/inc/widgets.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pet-manager/pet-manager.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/pet-manager/inc/extend.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/pet-manager/inc/metabox/boxes.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/pet-manager/inc/metabox/init.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/pet-manager/inc/form-action.php:110
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/pet-manager/pet_options_page.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/post-new.php?post_type=pet
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/pet-manager/inc/metabox/js/cmb.js?ver=6.3.1:67:26)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/post-new.php?post_type=pet
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,jquery-ui-core,underscore,thickbox,shortcode,moxiejs,plupload&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (A pet for adoption, single post view), #2 (A Lost pet, single post view, you can display a Google Map by providing an area or address), #3 (Widgets displaying last added pets, pets byt type, status etc and the search form), #4 (Pet post table in backend)
The official readme.txt is a good inspiration

pet-manager/pet-manager.php 92% from 13 tests

The main PHP file in "Pet Manager" ver. 1.4 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected2,820 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP94012021,590
PO File2303753667
CSS24622436
JavaScript41755127

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.37
Average class complexity29.83
▷ Minimum class complexity1.00
▷ Maximum class complexity148.00
Average method complexity9.24
▷ Minimum method complexity1.00
▷ Maximum method complexity91.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions43
▷ Named functions43100.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants7100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
22 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/img/adopted.png0.72KB0.60KB▼ 16.85%
inc/img/lost.png0.66KB0.58KB▼ 12.87%
inc/metabox/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
inc/metabox/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
inc/img/care.png0.51KB0.45KB▼ 11.83%