Developing WordPress Plugin for API

DigitalDev

Verified User
Joined
Jul 20, 2022
Messages
90
Hi community,

I m Scott from Scotland, myself and some friends have started up our own little projects site making plugins and modules for popular CMS and control panels etc.

As i use DA myself and come accross WordPress requests almost every day i decided it would be handy to control my server/domains from my own WordPress website so hence we are starting to make our own WPDA plugin.

The plugin will (when complete) will allow adding of multiple DA servers/connections, when adding new users and domains our plugin will load balance new users to available servers.

Notification service in the plugin will allow administrators to setup notification triggers such as services offline or email throttling and send alerts via SMS, Telephone call, URL or email.

We will also hook in the user/reseller packages into the WooCommerce for WordPress plugins so you can sell subscriptions in your WordPress and have the plugin activate/deactivate user accounts/packages.

You will be able to run backups from within WordPress, create/delete accounts and much more, easy [shortcodes] to display server or domain information throughout your WordPress site and WordPress-HOOKS which you can use to hook in your own plugin or application when events happen such as a new user is created or a new FTP/Email account etc etc.

I am reaching out to the community for your valuable feedback, suggestions and feature requests.

The plugin is in it's early stages of development but we are adding several new functions daily and intend on using as much of the DA API as we can.

If you would like to beta test the plugin in your own environment its easy to install just upload the .ZIP file via wordpress plugins manager and insert your server login details. Your logins are saved in your wordpress database encrypted and the encryption key is ioncube encoded so those with access to your databases cant see access to your server login details.

If you need a licence key just drop me a message with your email address and i will send you one over, there will be a lightweight version without the need for a licence key available from wordpress.org when we are ready to launch WPDA.
da_ss1.pngda_ss2.png
 

Attachments

  • WPDirectAdmin.zip
    31.9 KB · Views: 18
We have made some updates to the design for statistics, If already installed you can update the plugn within WordPress plugin manager automatic updates.
 

Attachments

  • dd_ss3.png
    dd_ss3.png
    34.7 KB · Views: 28
Being on AlmaLinux 8.6, LiteSpeed V8.0.1, PHP 7.4.30, I cannot activate the plugin, get error "Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/[redacted]/domains/[redacted]/public_html/wp-content/plugins/WPDirectAdmin/btc_encryption.php on line 5".
If you`d like send me an emailadress and I give you wp admin access.
 
Sorry ab out that, as i use that class in other plugins i handnt noticed an issue until i tested the plugin myself on a blank site, i have attached the fixed version for you to try, give that a go and hopefully you should get on better. Once installed you will get updates from the plugin manager daily when i push them at night.
 

Attachments

  • WPDirectAdmin.zip
    33.3 KB · Views: 25
Being on AlmaLinux 8.6, LiteSpeed V8.0.1, PHP 7.4.30, I cannot activate the plugin, get error "Parse error: syntax error, unexpected 'public' (T_PUBLIC) in /home/[redacted]/domains/[redacted]/public_html/wp-content/plugins/WPDirectAdmin/btc_encryption.php on line 5".
If you`d like send me an emailadress and I give you wp admin access.
On the same note if you do run into any problems and need support drom me an email to [email protected] we have a page https://btctech.co.uk/encrypted-credentials/ to store login details if we ever needed access to fix something for you however with wordpress plugins most things can be resolved with a patch/update.
 
I have almost finished the Packages Manager feature today.
You can:
  • Add/Remove user/reseller packages
  • Set the default package so if a package is removed it will switch all users on that package to the default.
  • Protect the default package from being deleted. (can be deleted manually in DA itself)
If a package is deleted manually in DA server itself when a user is loaded in WordPress plugin and it cant find the package the plugin will switch users to the default package, you can stop user switching in the user settings if you wish.
da_packages_manager.png
 
Problem to add server


2022-08-04 18:07:55.324404 [NOTICE] [3636833] [79.191.109.27:54055:HTTP2-19#-443] [STDERR] PHP Warning: Undefined array key "sub" in domains//public_html/wp-content/plugins/WPDirectAdmin/WPDirectAdmin.php on line 525

2022-08-04 18:08:01.552220 [NOTICE] [3636833] [79.191.109.27:54055:HTTP2-21#-443] [STDERR] PHP Fatal error: Uncaught Error: Call to undefined function mcrypt_get_iv_size() in domains//public_html/wp-content/plugins/WPDirectAdmin/btc_encryption.php:23

Stack trace:

#0 domains//public_html/wp-content/plugins/WPDirectAdmin/WPDirectAdmin.php(108): Encryption->encode()

#1 domains//public_html/wp-includes/class-wp-hook.php(307): WPDirectAdmin->add_server()

#2 domains//public_html/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters()

#3 domains//public_html/wp-includes/plugin.php(476): WP_Hook->do_action()

#4 domains//public_html/wp-admin/admin-ajax.php(187): do_action()

#5 {main}

thrown in domains//public_html/wp-content/plugins/WPDirectAdmin/btc_encryption.php on line 23
 
Hi sorry you are facing issues, the warning shouldnt be an issue but i will clean up that code, the second error mcrypt_get_iv_size() may be if you dont have mcrypt extension installed in your PHP setup. Can you check this for me?
 
I have now updated the plugin to save the server logins as plain text IF mcrypt is not loaded in your PHP, i will put in warnings etc in the plugin to highlight this and give the user the option to add MCRYPT to there php first.
 
Thank you so far guys for those getting involved and testing for me, its great to have another pair of eyes and diffirent skill levels and environments to test.

I am about to push a version update to add the new "add user package" function. This now allows you to add and remove user/reseller hosting packages. Version 1.2.0.0
 

Attachments

  • da_add_user_package.png
    da_add_user_package.png
    32.7 KB · Views: 7
Now working on next feature:

Linking existing user accounts to your internal WordPress Accounts, once a DA account is linked to a WP we can have short codes for users on the front end like [controlpanel] or [domain id="someusersdomain.com"] so the user has access to domain functions on your wordpress front end.

This user panel also has a feature to switch a user to a default package if a "custom" package is detected, again if a package is removed the plugin will switch any users on that package to the "default" package.

Once a user is linked we can sync password between accounts, if a user changes email address we can sync this information as well.

I will make PRO features to link multiple accounts together etc in the future once up and running.dd_user_panel.png
 
New version 1.2.2.0 pushed to update server with some prerequisits for future features such as added in some new database tables to record daily server statistics, we have added in CRON automation so we can perform automated checks and tasks through the wordpress cron class. I have also tidied up error messages and the admin user experience a little however i notice on mobile the popups for adding servers/users etc arent too clever yet.
server_add_popup.pngserver_set_popup.png
 
Been a busy night programming last night was up until 4AM!!!! Here are some new features in 1.2.2.2 i managed to get done.
= 1.2.2.2 =
Added new change password and suspend account features
Added in provisions for PRO features (extra features for pro members)
Added in SMS textlocal API
Now shows user email under info icon in user lists.
Added function to reboot server
Added a restart service feature and check_service function

If requested the plugin will notify user via email when there password is changed.change_passwd.png
Reboot services
reboot_a_service.png
Reboot Server
reboot_server.png
 
I have enhanced the security in a new version today, removed the local encryption key and replaced it with one served remotely with your licence key. If you deactivate the plugin your encrypted server login details will be no use to anyone reading it directly from the database, if you activate the plugin again with another licence key again those previous encrypted details will be no use.

Although upgrading from any current version you have installed shouldnt be a problem, i still removed and installed a new version just to keep things fresh.

You can download our first beta free version at https://digitaldev.org.uk/product/wpda/?attribute_license-type=Free
 
Since my NAMED service wont boot up i thought id use this as the perfect chance to get in service down alarms into the plugin, you can set alarms to trigger on any or all services on the server, alarms can be sent via SMS, EMAIL and URL where URL will post $data['service'] and $data[server_id] and $data[status;] TRUE|FALSE
ss_alaers.png
 
Back
Top