Site.pro Site.pro
  • AI Website BuilderAI Website Builder
    • AI Website BuilderAI Website Builder
    • Online StoresOnline Stores
    • PricesPrices
    • CollaborationCollaboration
    • Website ImportWebsite Import
    • PluginsPlugins
    • Website BuilderWebsite Builder
    • TemplatesTemplates
    • For Design StudiosFor Design Studios
    • Useful LinksUseful Links
    • Affiliate ProgramAffiliate Program
    • We Build for YouWe Build for You
    • ExamplesExamples
    • LanguagesLanguages
  • DomainsDomains
    • Register Domain NameRegister Domain Name
    • Migrate DomainsMigrate Domains
    • For Domain InvestorsFor Domain Investors
    • Domain ZonesDomain Zones
    • DomainityDomainity
    • FAQ: DomainsFAQ: Domains
    • Popular Domain ZonesPopular Domain Zones
    • .com.com
    • .org.org
    • .net.net
    • .us.us
    • .co.co
  • EmailEmail
    • Free EmailFree Email
    • Email for BusinessEmail for Business
    • PricesPrices
    • Transfer EmailsTransfer Emails
    • Custom Domain EmailCustom Domain Email
    • FAQ: EmailFAQ: Email
    • Popular FAQsPopular FAQs
    • Email SetupEmail Setup
    • Auto ReplyAuto Reply
    • Auto ForwardingAuto Forwarding
    • Spam ProtectionSpam Protection
  • Accounting SoftwareAccounting Software
    • Accounting SoftwareAccounting Software
    • ModulesModules
    • PricesPrices
    • Integrations, APIIntegrations, API
    • Accounting Companies (389)Accounting Companies (389)
    • Software Integrators (52)Software Integrators (52)
    • Affiliate PartnersAffiliate Partners
    • Useful LinksUseful Links
    • Business TypesBusiness Types
    • Use CasesUse Cases
    • Accounting CompaniesAccounting Companies
    • Sole ProprietorSole Proprietor
    • InvoicingInvoicing
    • FarmerFarmer
    • E-commerceE-commerce
  • For ResellersFor Resellers
    • White LabelWhite Label
    • Revenue ShareRevenue Share
    • PricesPrices
    • PanelsPanels
    • How it WorksHow it Works
    • Marketing MaterialsMarketing Materials
    • Mass ImportMass Import
    • Our PartnersOur Partners
    • Reselling ExamplesReselling Examples
    • DocumentationDocumentation
    • Free WebsitesFree Websites
  • LearnLearn
    • Knowledge BaseKnowledge Base
    • BlogBlog
    • Growth HackingGrowth Hacking
    • For HostingsFor Hostings
    • For EducationFor Education
    • Website Сreation TutorialWebsite Сreation Tutorial
    • Teaching Institutions (69)Teaching Institutions (69)
    • Accounting Courses WorldwideAccounting Courses Worldwide
  • AI Website BuilderAI Website Builder
    • AI Website BuilderAI Website BuilderAI creates websites for you
    • Online StoresOnline StoresBuild online stores
    • PricesPricesAdvanced Features
    • CollaborationCollaborationCo-create websites live
    • Website ImportWebsite ImportImport Any Website
    • PluginsPluginsBuilder plugin and functions
    • Website BuilderWebsite BuilderKey Features
    • TemplatesTemplates200+ Awesome Templates
    • For Design StudiosFor Design StudiosBenefits for Design Studios
    • Useful LinksUseful Links
    • Affiliate ProgramAffiliate Program
    • We Build for YouWe Build for You
    • ExamplesExamples
    • LanguagesLanguages
  • DomainsDomains
    • Register Domain NameRegister Domain NameDomain registration, parking, transfer
    • Migrate DomainsMigrate DomainsTransfer. Connect. Renew
    • For Domain InvestorsFor Domain InvestorsDiscount on all domains
    • Domain ZonesDomain ZonesBuy New Domain Name
    • DomainityDomainityDomain usage by country
    • FAQ: DomainsFAQ: DomainsFind Answer
    • Popular Domain ZonesPopular Domain Zones
    • .com.com
    • .org.org
    • .net.net
    • .us.us
    • .co.co
  • EmailEmail
    • Free EmailFree EmailCreate email
    • Email for BusinessEmail for BusinessAdvanced features & protection
    • PricesPricesCheap email hosting
    • Transfer EmailsTransfer EmailsMigrate your mailboxes
    • Custom Domain EmailCustom Domain EmailEmail address with your domain
    • FAQ: EmailFAQ: EmailFind Answer
    • Popular FAQsPopular FAQs
    • Email SetupEmail Setup
    • Auto ReplyAuto Reply
    • Auto ForwardingAuto Forwarding
    • Spam ProtectionSpam Protection
  • Accounting SoftwareAccounting Software
    • Accounting SoftwareAccounting SoftwareCloud based ERP
    • ModulesModulesMain accounting software modules
    • PricesPrices30 days free trial
    • Integrations, APIIntegrations, APIIntegration with external systems
    • Accounting Companies (389)Accounting Companies (389)Choose your partner for accounting
    • Software Integrators (52)Software Integrators (52)Pick your integrations partner
    • Affiliate PartnersAffiliate PartnersPartners and Affiliate program
    • Useful LinksUseful LinksCalculators and Calendars
    • Business TypesBusiness TypesUse Cases
    • Use CasesUse Cases
    • Accounting CompaniesAccounting Companies
    • Sole ProprietorSole Proprietor
    • InvoicingInvoicing
    • FarmerFarmer
    • E-commerceE-commerce
  • For ResellersWhite LabelFor ResellersWhite Label
    • White LabelWhite LabelCustomise Builder
    • Revenue ShareRevenue ShareEarn 50% from each upgrade
    • PricesPricesRevenue Share. White Label
    • PanelsPanelsOne product for all platforms
    • How it WorksHow it WorksCloud or On-Premises
    • Marketing MaterialsMarketing MaterialsVideo. Mockups. Blocks
    • Mass ImportMass Import
    • Our PartnersOur Partners
    • Reselling ExamplesReselling Examples
    • DocumentationDocumentation
    • Free WebsitesFree Websites
  • LearnLearn
    • Knowledge BaseKnowledge BaseFAQ, Tutorial, Video
    • BlogBlogSite.pro Blog
    • Growth HackingGrowth HackingBoost your sales
    • For HostingsFor HostingsTips on marketing
    • For EducationFor EducationTraining. Tutorials
    • Website Сreation TutorialWebsite Сreation Tutorial
    • Teaching Institutions (69)Teaching Institutions (69)
    • Accounting Courses WorldwideAccounting Courses Worldwide
  • RegisterRegister
    Site.pro

    Create Your Account

    Get started — free and easy!

    Register

    By proceeding, you accept our Terms of Service and Privacy Policy
  • Log inLog in
    Site.pro

    Welcome back!

    Access your work space

    Log in

    New user? Create account
    Forgot password?
  • $
    $
  • EnglishEnglish
Server Requirements
  • Published websites
  • Site.pro IPs
Builder installation / update
On-Premises
  • Server Requirements
  • Installation
  • CRON
  • Update
  • Migration to version v4
  • Collaboration Service
  • Extra configuration
  • Manual update
  • Changing PHP version
  • Support
Plugin installation
  • Hosting Panel
    • cPanel
    • DirectAdmin
    • Plesk
    • Sentora/ZPanel
    • ISPmanager
    • InterWorx
    • Vesta
    • Hosting Controller
    • Control Web Panel
    • Hestia
    • LiveConfig
    • Webuzo
    • Custom hosting (API)
  • Billing Panel
    • WHMCS
    • Blesta
    • Upmind
    • Custom billing (API)
API documentation
  • Builder
    • Create session (SSO)
    • Remove existing session
    • Create website backup
    • Restore website backup
  • Templates
    • List template categories
    • List template category tags
    • List templates
    • Get page types available in templates
  • Import
    • Import website
    • Get website import status
    • Import website block
    • Get website block import status
    • Check if imported website is owned by user
  • Websites
    • Create website
    • Modify website
    • Rename website
    • Publish website
    • Edit website pages
    • Edit website settings
    • Delete website
    • Get website template
    • Get website pages
    • Get website variables
    • Get template variables
    • Get website settings
    • Add pages to website
    • Duplicate pages in website
    • Remove pages from website
  • Website Blocks
    • Create empty website
    • Modify website
    • Inspect website
    • Add empty page
    • Modify page
    • Remove page
    • Inspect page
    • Inspect composition
    • Modification descriptor structure by element type
    • Add blocks from compositions
    • Remove blocks
    • Move blocks
    • Modify blocks
    • Inspect block
  • Licenses
    • Get list of published websites
    • Get statistics of publications/openings
    • Block/unblock published website
    • Controlling IP list
    • Read/add/delete hosting plans
  • Integration with your system
    • Allow/disallow domain in builder
    • Check if domains are allowed in builder
  • FAQ
    • Get posts
    • Get categories
Add-ons documentation
  • For Website
    • Public demo URL
    • Editing plans
    • User registration from public demo
    • Website import
    • Generate with AI
  • For Builder
    • Adding custom templates
    • Adding custom builder plugins
    • Scripts
For developers
  • Programming reference
  • Directory structure
  • Meta information (main.json)
  • Frontend logic (main.js)
  • Element template (main.html)
  • Backend logic (main.php)
  • Plugin testing
  • Custom element plugin
  • E-commerce plugin
  • Overriding UI
  • Other examples
Change Log
For developers

Backend logic (main.php) On-Premises

Sometimes it is not enough to use HTML/Javascript code for creating plugin. Often 3rd party plugins provide REST API for integration or manipulation of the system, for example:

  • shops require saving orders
  • plugins may use PHP libraries
  • plugins may require encrypting form fields before submitting what requires server-side script like PHP

To add PHP code into your plugin take the following steps:

  1. create file "main.php" in your plugin folder and write your PHP code
  2. open file "main.html" and add marker {{{requireService}}}. The marker will be replaced with PHP code in published website
  3. open file "plugins/plugins_whitelist.json" and add your plugin name to php list
Note.
PHP code is not loaded in site builder but only in published website.

Adding multiple PHP files to plugin

Let's say you develop plugin which integrates some 3rd party system to your site. This system provides PHP SDK which you want to use.
The PHP SDK can be a folder which contains one or multiple .php files, other folders containing other files, etc.
To add all this PHP library to your plugin take the following steps:

  1. create folder "site" in your plugin folder
  2. add all needed 3rd party files/folders into folder "site"

After that you will have access to folder "site" within your PHP file "main.php".
Let's presume you have file in your plugin "myplugin/site/SomeLibrary.php". Then you can load this file with line require_once("SomeLibrary.php"); in your PHP file.

© Site.pro 2011. Website Builder. United States.
Contact SalesContact SalesTerms of ServiceTerms of ServicePrivacy PolicyPrivacy PolicyCookie SettingsCookie Settings