78% wp-apn

Code Review | WordPress Apple Push Notifications Plugin

WordPress plugin WordPress Apple Push Notifications Plugin scored 78% from 54 tests.

About plugin

  • Plugin page: wp-apn
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Feb 28, 2015
  • Latest release: Feb 28, 2015
  • Number of updates: 2
  • Update frequency: every 18.5 days
  • Top authors: antongorodezkiy (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,269 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼3.16ms] Passed 4 tests

Server-side resources used by WordPress Apple Push Notifications Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1742.17 ▲2.46
Dashboard /wp-admin3.47 ▲0.1745.51 ▼4.81
Posts /wp-admin/edit.php3.59 ▲0.2348.94 ▲0.24
Add New Post /wp-admin/post-new.php6.05 ▲0.1788.42 ▼10.51
Media Library /wp-admin/upload.php3.40 ▲0.1738.82 ▲2.84
WordPress APN /wp-admin/options-general.php?page=wp-apn3.4632.49

Server storage [IO: ▲1.73MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • Illegal file modification found: 1 file (0.00KB) outside of "wp-content/plugins/wp-apn/" and "wp-content/uploads/"
    • (new file) wp-content/wp-apn-logs/.empty
Filesystem: 115 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WordPress Apple Push Notifications Plugin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲6913.30 ▼1.331.92 ▲0.2242.69 ▲0.01
Dashboard /wp-admin2,210 ▲194.84 ▼1.07107.21 ▲3.0337.69 ▼8.74
Posts /wp-admin/edit.php2,093 ▲42.18 ▲0.1836.05 ▲1.4232.06 ▼5.84
Add New Post /wp-admin/post-new.php1,545 ▲318.17 ▼0.03599.44 ▼31.3762.35 ▲3.10
Media Library /wp-admin/upload.php1,392 ▲44.29 ▲0.1096.61 ▼9.4841.95 ▼2.94
WordPress APN /wp-admin/options-general.php?page=wp-apn2,8444.2059.4776.68

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

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

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wp-apn
    • > Warning in wp-content/plugins/wp-apn/views/settings.php+232
    Use of undefined constant LINKED_ARTICLES_PLUGIN - assumed 'LINKED_ARTICLES_PLUGIN' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=wp-apn
    • > Warning in wp-content/plugins/wp-apn/controllers/Plugin.php+91
    Use of undefined constant WPLANG - assumed 'WPLANG' (this will throw an Error in a future version of PHP)

SRP 50% 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
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WPAPN_ApiController' not found in wp-content/plugins/wp-apn/controllers/MyApiController.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
7 plugin tags: notification, apns, apple, apn, apple push notifications...

wp-apn/wp-apn.php Passed 13 tests

"WordPress Apple Push Notifications Plugin" version 1.0.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
82 characters long description:
Plugin gives you an API to send Apple Push Notifications from your WordPress site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected13,365 lines of code in 96 files:
LanguageFilesBlank linesComment linesLines of code
CSS421,2991,5237,907
Sass1430261,291
PHP103451961,276
LESS1423351,247
SVG100520
Markdown42280462
HTML11145380
JavaScript54478188
JSON50094

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity15.75
▷ Minimum class complexity1.00
▷ Maximum class complexity45.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes112.50%
▷ Concrete classes787.50%
▷ Final classes00.00%
Methods55
▷ Static methods3665.45%
▷ Public methods5090.91%
▷ Protected methods59.09%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
7 PNG files occupy 0.19MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
documentation/img/logo.png12.09KB4.75KB▼ 60.70%
assets/img/logo.png12.09KB4.75KB▼ 60.70%
assets/img/fabric_of_squares_gray.png55.15KB57.35KB0.00%
documentation/img/fabric_of_squares_gray_@2X.png56.09KB66.22KB0.00%
assets/img/notification.png0.55KB0.78KB0.00%