Categories
Geekery

JetPack is getting smarter and smarter

Recently today, I upgraded my PHP version to 7.4.4. After a few minutes, I received an e-mail that my website is offline. It says that “Your Site is Experiencing a Technical Issue”. But good thing, I have JetPack. Gone are the days when your WordPress website is down or just blank white, and you don’t know what to do.

Now, non-living things are getting smarter and smarter. I now know why my website is down and what’s the root cause of the issue. No need to troubleshoot it anymore. You’ll receive a link to enter your website in “recovery mode”, and you will also receive via e-mail all the details about which plugins caused the issue.

Mine was this:

Current plugin: Audio player (version 2.0.4.6)

Error Details
=============
An error of type E_PARSE was caused in line 903 of the file /wp-content/plugins/audio-player/audio-player.php. Error message: syntax error, unexpected ‘new’ (T_NEW)

So I just went ahead to my server and deleted that specific plugin that I don’t even use anymore. And eureka! My website is back online! Easy peasy right?

Categories
Geekery

Single PHP file to send push notification via OneSignal REST API

Here’s a single php file where you can send a push notification using your OneSignal account via REST API. It’s simple and straightforward using the code example at OneSignal.com. This one is more complete as the code example is just the curl_setopt code. But what if you don’t know how to POST the code from your form to send a message using the basic example from OneSignal REST API? Example in this link are all just API parameters with basic code example, no actual code example with an HTML form that will work if you copy paste it.

Categories
Geekery Internet Software

Formidable Calendar Custom Time Slots Per Hour of the Day

Formidable form building is one of the best and most extensive, fully customisable, WordPress plugin out there. You can create all types of forms you can think of. From a simple contact form, to a complex booking form, or even a full-featured user database with lots of filters and search features.

But even if Formidable Pro is this powerful, there are still some things that Formidable Pro cannot do. One is allowing different number of slots per hour of the day. Out of the box, Formidable’s calendar and time field can let you limit the number of slots per day by a few lines of code.

Categories
Geekery

Wow! PHP 5.4.0 has been released!


I recently updated my server to 5.3.10 and now PHP 5.4.0 has been released! The PHP said that the release is a major leap forward in the 5.x series, which includes a huge number of new features and bug fixes.

They key new features of PHP 5.4 are traits, DTrace support, a shortened array syntax, a built-in webserver for testing purposes and a whole lot more, check it out here. You can download the latest stable version here if you want to try it out. This PHP version greatly improves performance and memory footprint. There were also more than 100 bugs fixed in this version.

Categories
Geekery

Worpress error on line 2 at column 6: XML declaration allowed only at the start of the document


The error on line 2 at column 6: XML declaration allowed only at the start of the document on my WordPress feed is really annoying. I spent more than 10 hours trying to fix this error myself. I’m really frustrated because I’ve tried all the solutions I found online but to no avail. I’m almost about to loose hope and just pay someone on fiverr for $5 to fix my error. But my pride stopped me. I’ll be such a loser if I can’t fix this simple error myself. Other have fixed it, a $5.00 can fix it, why can’t I?

Categories
Geekery Internet

Modify the WordPress Tag Cloud Widget Easily


There are numerous ways of how to modify the WordPress tag cloud widget, but there’s an easy way to modify it. I searched about how to modify such, and landed on different blogs sharing different methods to modify the widget. I also landed on this page which tells everyone to modify the WordPress core. But I don’t think it’s the best solution to customize your WordPress Tag cloud.

Categories
Geekery

Elegant Themes ePanel: Add All Categories in Featured Category Options


If you’re an Elegant Themes user and you’re a complete PHP noob and you want to add “All Categories” as an additional option in your featured category inside your ePanel, because by default, there are no “All Categories” option in the featured category options of Elegant Themes’ ePanel, then your search is over.

Categories
Geekery

Change your PHP handler from mod_php (DSO) to suPHP

Finally, I decided to change my server’s PHP handler to suPHP from mod_php. It’s more secure and I can update my plugins and WordPress files automatically without annoying permission errors.

Here’s what my php config looks like after the update:


php.conf updated to:
# This file was automatically generated by the Cpanel PHP Configuration system
# If you wish to change the way PHP is being handled by Apache on your system,
# use the /usr/local/cpanel/bin/rebuild_phpconf script or the WHM interface.
#
# Manual edits of this file will be lost when Apache is updated.
# SuPHP configuration for PHP5
LoadModule suphp_module modules/mod_suphp.so
suPHP_Engine on
AddType application/x-httpd-php5 .php5 .php4 .php .php3 .php2 .phtml

    suPHP_AddHandler application/x-httpd-php5

# End of autogenerated PHP configuration.
Updating user configurable PHP settings.
[info] recursion depth is set to: 2
Restarting Apache

Now, I can update WordPress hassle free!

To change your php handler, you should have WHM root access. This is the only way I know. I think you can change it via SSH, but I haven’t tried it yet.

Once you’re logged in as root, just go to Service Configuration > Configure PHP and SuExec > Alter Configuration > PHP 5 Handler > Select suPHP.

Once you’ve selected suPHP, just click “Save New Configuration”.

That’s it!