News on Eazy Ad Unblocker

Hello everyone!

A few months ago, I had launched a wordpress plugin called “Eazy Ad Unblocker”.  You can read about it from https://myplugins.net/announcing-eazy-ad-unblocker/. You can download it from https://wordpress.org/plugins/eazy-ad-unblocker/.
You can preview it at https://myplugins.net/demo/
Don’t forget to keep your adblocker on while browsing the preview URL.

The plugin notifies a user of a wordpress site if they are using
an adblocker.They are prompted to disable their adblocker or
whitelist the webmasters site in their adblocker settings. This helps
all those site owners whose paid advertising is being blocked by users
by installing adblocker extensions in their browsers.

Over the past few months, since its launch a few months ago, the plugin seems to be gaining some traction on the web.

Its number of active installations has crossed 100. At the time of writing, 1,714 people had downloaded it. The plugin has also found a mention at https://www.adventurewp.com/best-anti-adblock-plugins-for-wordpress/

Adventure WP describes the plugin as a “dead-simple plugin” which is “very lightweight and simple to set up”.

Furthermore, in their words “Eazy Ad Unblocker” actually provides “less customization while also providing more. but you do have full text input available for your title and main notice text. It also uses the regular
classic-style WordPress text editor so you can include nearly anything in
your anti-adblock notice–images, HTML, video, whatever TinyMCE
allows you to embed.”

On a critical note, they believe that the design of the popup dialog is “a bit dated”. That’s something that needs to be worked on I guess. Also they note, “You don’t have different anti-adblock methods, nor do you have color customization”.

Finally, they note that Eazy Ad Unblocker is an absolutely usable plugin, which does not lock a facility to dismiss the popup behind a pay wall!

Thank you Adventure WP guys!

Note: Please note that “Eazy Ad Unblocker” now has a popup refresh button. Whitelist the site in your adblocker or disable it and then click “Refresh” at the bottom of the popup dialog. The popup will go away.

Photo credit: https://www.adventurewp.com/best-anti-adblock-plugins-for-wordpress/

Sample Code for Algorithm to Create Combinations of Characters

In my post here, I described an algorithm to create all possible combinations from a set of characters. However, it allows repetitions of characters in the generated combinations. e.g aas, aaa and so on.
In this post, I will demonstrate an implementation of this algorithm in PHP, without any parallelization of any kind. I don’t know if it’s even possible to parallelize code in PHP.

You can run this code on LAMPP, WAMP, MAMP or XAMPP if you like. Successive trials of code execution may be faster than previous ones. Maybe, you all won’t like this code since it uses the “goto” keyword which is believed to lead to the creation of spaghetti code.  However, this was the easiest way to implement the algo for me.

<?php 

$dictionary = array('a', 'b', 'c', 'd', 'e');

$startLen = 1;
$stopLen = 4;

$currLen = 1;

//function to create string combination from array of indices
function getStringFromChars($indices)
{
  global $dictionary;
  $str='';

  for($j = 0; $j < count($indices); $j++)
  {
    $str.=$dictionary[$indices[$j]];
  }
  
  return $str;
}

//check condition to stop generating combos
function timeToStop($indices)
{
  
  global $dictionary;
  
  $stop = false;
  
  for($j = 0; $j < count($indices); $j++)
  {
    if($indices[$j] < count($dictionary) - 1)
    {
      return $stop;
    }
  }

  $stop = true;
  
  return $stop;
}

//main function
function generate($startLen, $stopLen)
{
  global $dictionary;
  $attempts = 0;
  
  for($currLen = $startLen; $currLen <= $stopLen; $currLen++)
  {
    step3:
    $chars = array();
    
    $indices = array();
    
    //init the arrays
    for($i = 0; $i < $currLen; $i++ )
    {
      $indices[$i] = 0;
      
      $chars[$i] = $dictionary[$indices[$i]];
    }
    
    step4:
    $working_index = $currLen - 1;
    
    step5:
    $str = getStringFromChars($indices);
    
    step6:
    echo $str;
    echo "<br />";
    $attempts++;
    
    if(timeToStop($indices))
    {
      if($currLen < $stopLen)
      {
        
        continue;
      }
      else
      {
        break;
      }
    }
    
    if($indices[$working_index] < count($dictionary) - 1)
    {
      $indices[$working_index]++;
      goto step5;
    }
    else
    {	
      if($currLen > 1)
      {

      
        while($indices[$working_index] == count($dictionary) - 1)
          $working_index--;
          
        if($working_index == -1)
        {
          if($currLen < $stopLen)
          {
            
            continue;
          }
          else
            break;
        }
        else
        {				
          $indices[$working_index]++;
          //set all indices to the right of working_index to 0
          
          for($k = $working_index + 1; $k < count($indices); $k++)
          {
            $indices[$k] = 0;
          }
          
          goto step4;
        }	
      }
      else
      {
      
        if($currLen < $stopLen)
        {
          
          continue;
        }
        else
          break;
      }
    }
    
  }

  return $attempts;
}

$start = microtime(true);

$atts = generate($startLen, $stopLen);

$end = microtime(true);

$time_taken = $end - $start;

$rate = $atts / $time_taken;

echo "Time(seconds): ".$time_taken;
echo "<br />";

echo "Attempts: ".$atts;
echo "<br />";

echo "Rate: ".$rate." iterations per second";