ClassicPress Development with GitHub: Create Repository

GitHubWhen I started developing plugins for ClassicPress I decided that I needed to be using source control. As ClassicPress is intending to use GitHub for their plugin directory, it made sense for me to use it as well. This post is part of a series on ClassicPress Development with GitHub.

With us now signed up for GitHub, we can create our first repository. From your dashboard (which is https://github.com/ followed by your username), click the New repository button:

Create a new repository on GitHub

Continue reading “ClassicPress Development with GitHub: Create Repository”

ClassicPress Development with GitHub: Sign up for GitHub

GitHubWhen I started developing plugins for ClassicPress I decided that I needed to be using source control. As ClassicPress is intending to use GitHub for their plugin directory, it made sense for me to use it as well. This post is part of a series on ClassicPress Development with GitHub.

The first step to using GitHub for developing with ClasssicPress, is to create a GitHub account; navigate to the landing page, enter a Username, Email and Password and click the large green Sign up for Github button:

Sign up for GitHub

Continue reading “ClassicPress Development with GitHub: Sign up for GitHub”

ClassicPress Development with GitHub: Series Index

GitHubI have been using ClassicPress to run this blog, and several other sites, since early last year. I have also created new versions of all of my plugins for ClassicPress.

When I was working with plugins for WordPress, I used their Plugin Repository for source control which was based off SVN. This wasn’t really the ideal way of doing things, as I should have had my own source control for development purposes.

At the start of 2019, GitHub announced new unlimited repositories (amongst some other changes) which made GitHub a viable source control tool for me.

The added bonus of using GitHub is that ClassicPress mean to use it for their Plugin Directory which is scheduled for inclusion in version 2. Development of this is in the early stages now, but using GitHub for my own development means I am at least part way to being compatible with the directory when it is launched.

I have over a hundred repositories now on GitHub (although you’ll see a much smaller number as quite a few are private). I took some screenshots when I started and meant to blog about it and then got sidetracked. In this series of posts I am going back to my intended posts, in which I am going to cover the basics of using GitHub for development of ClassicPress plugins.

This is a weekend series of posts with new posts going live over the next few weeks. If you’re reading this on azurecurve|Ramblings of a Dynamics GP Consultant the index will update automatically.

azurecurve ClassicPress Plugins updated

ClassicPress PluginsI migrated to ClassicPress last year and created ClassicPress versions of all of my plugins. This wasn;t just a case of creating an alternate versions, but extensively rewriting them in order to both add new functionality and to improve their security.

I’ve recently made changes to them all again to further improve them. If you use any of my plugins list on my Development site, you should download and install the latest version.

ClassicPress v2 is to include a Plugin Directory which is meant to be available in the second-half of 2020 which will mean automatic updates will then be available.

WordPress/ClassicPress Plugin Development: Checking If Function Exists In Namespace

WordPress PluginI’ve been developing my own plugins for WordPress and, more reently, ClassicPress. At times it’s been necessary to check if a function exists.

It’s fairly straightforward to do this check:

if (!function_exists('azrcrv_get_breadrumbs')){
	// code here
}

I also use a few plugins developed by other people. One of the ones I’ve been reviewing recently is Estimated Read Time by CodePotent.

John uses namespaces in his plugins which means the check also needs to include the namespace. You can check for this using the following syntax (the highlighted section is the namespace defined in the plugin):

if (function_exists('CodePotent\EstimatedReadTime\process_shortcode')){
	// code here
}

I’m posting this as a reminder to myself as it took me a few minutes of searching before I found the right answer.

Remove Yellow Background from Google Adsense Adverts

Microsoft Dynamics 365 Business CentralI’ve been hosting adverts from Google Adsense for a while and, after my last site redesign, I started using responsive adverts which scale according to the size of the browser window (or device size).

Since then, I’ve had yellow background showing either side of the adverts:

Adverts with yellow bars

The other day, I finally had time to track down and fix the issue. The html code for the adverts, which is supplied by Google, places the adverts within an ins tag and a class of adsbygoogle (see two highlighted sections):

...<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
				<!-- azurecurve Responsive Leaderboard -->>
				<ins class="adsbygoogle"
					 style="display:block"
					 data-ad-client="{adsense publisher id}"
					 data-ad-slot="5299901990"
					 data-ad-format="auto"></ins>
				<script>
				(adsbygoogle = window.adsbygoogle || []).push({});
				</script>...

The yellow background is the default colour used by WordPress for ins tags; so to remove it, all you need is a snippet of css in your stylesheet:

ins.adsbygoogle {
	background: transparent;
}

With the css saved, the yellow background disappears:

azurecurve Posts Archive WordPress Plugin – Beta Testers Wanted

WordPress PluginI recently created a WordPress archive of my Twitter posts using the plugin and theme from Ozh.

Part of the theme was a sidebar posts archive which I quite liked the look of and have now extracted and turned into a WordPress plugin so I can use it on any site (including this one):

azurecurve Posts Archive

Check out the archive in action in the sidebar to the right below the Calendar and above the Tag Cloud.

I am thinking about releasing it via the WordPress Plugins Directory, but before doing so, wondered if anyone might be interested in doing some beta testing? It is a very easy install (upload to plugins folder, activate and then place widget in widget area) and currently has no options although I am willing to create some if necessary (such as the ability to change the display name).

The plugin only reads the number of posts and does not write back to the database so there is no risk.

If you’re interested in beta testing get in touch with me (by email if you have it or use the Contact page) and I’ll send you a download link (I’m not posting publicly as I want to keep numbers under control while it gets tested).