OOP

You are currently browsing the archive for the OOP category.

Peter Westwood and some other WordPress core developers have written a great plugin for WordPress plugin and theme developers: the Debug Bar. It plugs into the Admin Bar that was introduced with WordPress 3.1 and outputs various details about the current page, but to (super) admins only.

Thanks to the consequent usage of WordPress Plugin API functions there is a fairly easy and straightforward way of outputting your own debug information into the Debug Bar.

Your own Debug Bar Panel

You should create a separate file for your Debug Bar tab, let’s call it my-debug-bar-panel.php, and place it in the same directory as your plugin file or your theme’s functions.php file. In this file you create a child class of Debug_Bar_Panel, e.g. my_Debug_Bar_Panel, with at least one method render() in which you can output everything that should be on your tab.

<?php
class my_Debug_Bar_Panel extends Debug_Bar_Panel
{
  function render()
  {
    echo '<div id="my-debug-par-panel">';
    echo '<h3>Some header</h3>';
    echo '<p>Some debug output</p>';
    echo '</div>';
  }
}

Now back to your main plugin file or functions.php: You need a function that hooks into debug_bar_panels. I put a double check in my example to make sure the base class Debug_Bar_Panel exists (since you never know whether they drop this in a future release which would cause fatal runtime errors). Then you create a new instance of my_Debug_Bar_Panel with the title, which you would like to see on your tab, passed to the constructor:

function my_debug_bar_panels($a)
{
  if (class_exists('Debug_Bar_Panel'))
  {
    require_once dirname(__FILE__).'/my-debug-bar-panel.php';
    $a[]=new my_Debug_Bar_Panel('My tab title');
  }
  return $a;
}
add_filter('debug_bar_panels', 'my_debug_bar_panels');

Believe it or not, you’re done!

I was in need of a PHP class to encrypt hash and verify passwords using salted sha1 hashes. Here it is, quick but not too dirty:

<?php

class SSHA
{

  public static function newSalt()
  {
    return chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255)).chr(rand(0,255));
  }

  public static function hash($pass,$salt)
  {
    return '{SSHA}'.base64_encode(sha1($pass.$salt,true).$salt);
  }

  public static function getSalt($hash)
  {
    return substr(base64_decode(substr($hash,6)),20);
  }

  public static function newHash($pass)
  {
    return self::hash($pass,self::newSalt());
  }

  public static function verifyPassword($pass,$hash)
  {
    return $hash == self::hash($pass,self::getSalt($hash));
  }

}
Download and Watch Full Movie Kingsman: The Golden Circle (2017)
  • Kingsman: The Golden Circle (2017)

  • Duration
    141 mins
    Genre
    Action, Adventure, Comedy.
  • In Cinemas
    September 20, 2017
    Language
    svenska, English, Italiano.
  • Country
    United States of America.
  • Watch Full Movie Kingsman: The Golden Circle (2017)

Plot For Kingsman: The Golden Circle

Movie ‘Kingsman: The Golden Circle’ was released in September 20, 2017 in genre Action. Matthew Vaughn was directed this movie and starring by Colin Firth. This movie tell story about When an attack on the Kingsman headquarters takes place and a new villain rises, Eggsy and Merlin are forced to work together with the American agency known as the Statesman to save the world.

DIRECTOR

Matthew Vaughn.

Producer

Matthew Vaughn, Adam Bohling, David Reid.

Writer

Matthew Vaughn, Jane Goldman.

Production Company

Twentieth Century Fox Film Corporation, Marv Films, TSG Entertainment.

Incoming search term :

Streaming Kingsman: The Golden Circle 2017 Online Free Megashare, Watch Kingsman: The Golden Circle 2017 Online 123movie, Kingsman: The Golden Circle 2017 movie download, download Kingsman: The Golden Circle movie now, Watch Kingsman: The Golden Circle 2017 Online Megashare, Kingsman: The Golden Circle movie streaming, streaming Kingsman: The Golden Circle 2017 movie, trailer movie Kingsman: The Golden Circle, download movie Kingsman: The Golden Circle 2017, live streaming film Kingsman: The Golden Circle online, Watch Kingsman: The Golden Circle 2017 Online Free 123movie, watch film Kingsman: The Golden Circle 2017 now, film Kingsman: The Golden Circle online streaming, Kingsman: The Golden Circle 2017 Watch Online, Kingsman: The Golden Circle 2017 film download, Watch Kingsman: The Golden Circle 2017 Online Free Viooz, watch full Kingsman: The Golden Circle film, Kingsman: The Golden Circle movie, Watch Kingsman: The Golden Circle 2017 Online Free, live streaming film Kingsman: The Golden Circle, Watch Kingsman: The Golden Circle 2017 Online Free Putlocker, Watch Kingsman: The Golden Circle 2017 For Free online, Watch Kingsman: The Golden Circle 2017 Online Free hulu, movie Kingsman: The Golden Circle 2017 download, Streaming Kingsman: The Golden Circle 2017 For Free Online, watch full Kingsman: The Golden Circle 2017 movie online, Watch Kingsman: The Golden Circle 2017 Online Putlocker, watch full film Kingsman: The Golden Circle 2017, Kingsman: The Golden Circle film trailer, Watch Kingsman: The Golden Circle 2017 Online Free netflix, Watch Kingsman: The Golden Circle 2017 Online 123movies, watch Kingsman: The Golden Circle 2017 movie now, download full film Kingsman: The Golden Circle 2017, film Kingsman: The Golden Circle 2017 online, Watch Kingsman: The Golden Circle 2017 Online Free megashare, watch full movie Kingsman: The Golden Circle online, Watch Kingsman: The Golden Circle 2017 Online Viooz,

July 26, 2009 | Permalink